3 ms·
This blog post is doing precise integer arithmetic without rounding, and dealing with polynomials of tiny degree. But for more general uses... Anyone trying to
by jacobolus 11y ago
This blog post is doing precise integer arithmetic without rounding, and dealing with polynomials of tiny degree. But for more general uses...
Anyone trying to work with polynomials as continuous functions using floating point arithmetic (or trying to work efficiently with piecewise continuous functions in general) should check out Chebfun, http://www.chebfun.org http://www.chebfun.org
People should avoid working with polynomials expressed in the monomial basis if possible, unless dealing with a function defined on the complex unit circle. The Chebyshev basis is generally faster and more accurate for polynomials defined on some real interval, and makes it practical to compute with polynomials of very high degree. http://www.chebfun.org/examples/linalg/CondNos.html http://www.chebfun.org/examples/linalg/CondNos.html http://www.chebfun.org/examples/roots/RandomPolynomials.html http://www.chebfun.org/examples/roots/RandomPolynomials.html
For a lot more see: http://www.chebfun.org/ATAP/atap-first6chapters.pdf http://www.chebfun.org/ATAP/atap-first6chapters.pdf http://www.chebfun.org/docs/guide/chebfun_guide.pdf http://www.chebfun.org/docs/guide/chebfun_guide.pdf
Here’s the guts of their multiplication routine, which multiplies two polynomials and returns a new polynomial which approximates the product to near machine precision:
https://github.com/chebfun/chebfun/blob/development/%40chebtech/times.m#L141-L161 https://github.com/chebfun/chebfun/blob/development/%40chebt... (For the mathematical details see the (paywalled) paper http://epubs.siam.org/doi/abs/10.1137/120865458?journalCode=siread http://epubs.siam.org/doi/abs/10.1137/120865458?journalCode=...). Multiplying values at Chebyshev points (similar to the blog post under discussion) would work too, but Chebfun natively stores an array of coefficients. In fact, they did multiply at values before April of last year, https://github.com/chebfun/chebfun/blob/05611dec557718b5b026232ed3f4edcef8e7a19e/%40chebtech/times.m#L89-L113 https://github.com/chebfun/chebfun/blob/05611dec557718b5b026...
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]