GithubHelp home page GithubHelp logo

Comments (12)

ajt60gaibb avatar ajt60gaibb commented on June 11, 2024

I agree, prolong.m should change as Clenshaw is better than bary in the regime of small degree.

In get: This is actually a rare case when bary is faster than Clenshaw (1 evaluation point, potentially large degree). Nick H and I did some experiments a while ago.

Smoothfun.m is using Floater-Horner interpolation (it looks like). So that should stay.

Perhaps, we should completely change to Clenshaw since its far cleaner message: "Clenshaw for evaluation". I would support prolong.m and get.m changing to Clenshaw. Unless someone feels the small efficiency lose in get.m is important.

from chebfun.

kuanxu avatar kuanxu commented on June 11, 2024

I suggest that we replace the bary in get as well, so long as clenshaw is not much slower than bary for get. On the one hand, this can make the things in chebtech simpler and more uniform. On the other hand, if we use bary we have to update values before doing the evaluations. But there is an occasion (maybe more in the future) where we want to get the function values at the boundaries without updating the field 'values', for examples: extractBoundaryRoots.m. In this occasion, updating the field 'values' only for calling bary is a waste.

from chebfun.

ajt60gaibb avatar ajt60gaibb commented on June 11, 2024

OK, I don't know about extractBoundaryRoots.m. Though, I would expect the values field to be updated after every operation. It is really that expensive to update the values (one FFT), when roots are being computed. Perhaps, I've missed the point. Anyway, since your argument supports the "Clenshaw for evaluation" campaign, I'm happy! 👍

from chebfun.

aaustin141 avatar aaustin141 commented on June 11, 2024

Good catch!

I second the idea of changing prolong() and chebtech1.get() (chebtech2.get() doesn't call bary()) to use clenshaw(). I'd be willing to bet that the performance hit from changing in chebtech1.get() is pretty unimportant, and, as @ajt60gaibb has already pointed out, using clenshaw() everywhere sends a simpler, more uniform message.

@kuanxu: I'm not sure what you mean with regard to extractBoundaryRoots(). All chebtech methods need to maintain the class invariant that the values and coeffs fields are up-to-date with one another. If extractBoundaryRoots() returns a chebtech for which this isn't true, it's a bug!

from chebfun.

kuanxu avatar kuanxu commented on June 11, 2024

Yes. If we are not losing much, go uniform always.

@aaustin141: It seems that I didn't explain clearly. In fact, there is a while loop in extractBoundaryRoots where we only need to update coeffs to proceed to the next iteration. But boundary values are checked at the beginning of each loop. Now we have to update values too in each iteration to make sure that get and the underlying bary work.

from chebfun.

kuanxu avatar kuanxu commented on June 11, 2024

BTW, bary shows up in legpts.m as well, which is beyond my universe.

from chebfun.

aaustin141 avatar aaustin141 commented on June 11, 2024

@kuanxu: OK, I see what you mean. I just looked at the code now.

Assuming we weren't going to switch chebtech1.get() to use clenshaw() (and I think we are), you could always work around it in that kind of a situation by calling clenshaw() directly.

from chebfun.

kuanxu avatar kuanxu commented on June 11, 2024

@aaustin141: True. This is what I'm going to do for time being.

from chebfun.

ajt60gaibb avatar ajt60gaibb commented on June 11, 2024

@kuanxu: You're right legpts.m and jacpts.m does use bary to numerically compute coefficients in the boundary asymptotic formula. I think for legpts we also use it for local Taylor expansions of Bessel. Before changing this I would like to make sure that we still nail every digit at the boundary with Clenshaw.

from chebfun.

nickhale avatar nickhale commented on June 11, 2024

@kuanxu, @ajt60gaibb: I think legpts() and jacpts() should be left out of this discussion. They are not tied to the @chebtech class, and should be free to use bary() if they so wish.

from chebfun.

ajt60gaibb avatar ajt60gaibb commented on June 11, 2024

Sorry, GITHUB decided to put the "Comment" button right next to the "Close" button. I'll drink less coffee to stop the twitching!

from chebfun.

aaustin141 avatar aaustin141 commented on June 11, 2024

This has now been sorted out in the pull request issue #32.

from chebfun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.