4 ms·
Good point. I think, that if you're aiming for the speed, Chebyshev polynomials may even be excessive. It's unlikely that a high order polynomial will beat the
by okaleniuk 6y ago
Good point. I think, that if you're aiming for the speed, Chebyshev polynomials may even be excessive. It's unlikely that a high order polynomial will beat the hardware implementation. And for tiny polynomials it's best to spend the sparse grid values for the special points.
E. g., you can get your approximation both smooth and continuous by adding the target derivatives in +-PI/2 into the Vandermonde matrix. The overall error may become higher with the same polynomial order but the approximation will be smooth.
- 0xfaded 6y agoGenerally you sum the coefficients from the polynomials to get a single set of coefficients. They are usually very close to the Taylor approximation.
- okaleniuk 6y agoYes, indeed. What I mean is, with Chebyshov polynomials, you will avoid Runge effect but it's not an issue for a small order polynomial. And to win against the hardware implementation, you have to keep your polynomial small. I measured this for a contemporary Intel processor some maybe ten years ago and found out that 6th degree (actually, its 3 for x^2 since you can throw away all the even coefficients) makes sense performance-wise, yes the error is greater but that's the point of the trade-off. But even 8 or 10 is already doubtful. Of course, there are architectures other than Intel and it might make sense to use higher order polynomials for better accuracy there.