Inverse functions using TaylorSeries.jl

There is a bunch of issues reported here. I’ll try to clarify some of them, while I get to understand the others. Thanks a lot for the reference. As for the race condition you report, I can’t check it now; please do open an issue in TaylorSeries.jl to follow this up.

What I understand from the code with exp and its inverse (log), and the fact that you are using a quite high order, is that you are interested in checking how the series behaves as you approach the radius of convergence. The following shows that the series does converge, though slowly:

for ord = 100:100:500
    t = Taylor1(ord)    # independent variable of order `ord`
    p = exp(t)
    q = inverse(p-1)
    l2 = q(1.0)    # equivalent to `evaluate(q, 1.0)`
    @show(ord, l2-log(2.0))
    println()
end

ord = 100
l2 - log(2.0) = -0.004975001249750366

ord = 200
l2 - log(2.0) = -0.0024937500781213595

ord = 300
l2 - log(2.0) = -0.0016638889043206762

ord = 400
l2 - log(2.0) = -0.0012484375048821272

ord = 500
l2 - log(2.0) = -0.0009990000019985956

As it can be seen, the difference of evaluating the Taylor polynomial to log(2) gets smaller as the order is increased.

I should clarify that evaluate uses Horner’s method, so there is no interpolation for computing the evaluation of the polynomial itself, nor in the computation of the coefficients of the series. Certainly, there is a loss of accuracy, which is due to the fact that the coefficients have finite precision, and that you are evaluating the series at the radius of convergence.

4 Likes