06/10/2014, 10:38 AM
(This post was last modified: 06/10/2014, 11:02 AM by sheldonison.)
(06/10/2014, 09:42 AM)mike3 Wrote: Ah, so it gives n/2 correct digits (or thereabout), then. So at the 340 or so digits I was using, it should've had around 170 digits correct, which would probably have been enough to get the 32nd derivative provided the epsilon was not too small (I think I used 1e-4 or so, maybe 1e-5 but the last one may have been pushing it, although 1e-4 still produces a graphable approximation of the derivative).There is an internal "xsexp" Taylor series polynomial at zero, that should work well for the derivatives. Earlier, I tried "\p 134", and that was starting to show significant errors (>0.1%) for the 100th derivative at x=0.5, since the higher order derivatives started to dominate the error term, and there wasn't enough precision in those higher order Taylor series terms. but that was at "\p 134".
Also, you could use the internal function, sexptaylor(z0,r), where r is the sample radius for a 200 term polynomial generated via Cauchy approximation radius r centered at z0. The following algoritm will give accurate results for the 150th derivative, but starts to fall apart near the 175th derivative. Perhaps I could add the option for more sample points on sexptaylor when used with higher precision.
Code:
\p 134
init(exp(1));
dnz(n,z)={for (i=1,n,z=deriv(z));z}
default(format,"g0.14")
d150=dnz(150,sexptaylor(0.5,1));
print ("150th derivative at 0.5= "polcoeff(d150,0));
150th derivative at 0.5= 2.4946223112445 E207Alternatively, this algorithm works accurately to about the 370th derivative at x=0.5.
Code:
\p 539
init(exp(1)); /* wait about 2 hours */
dnz(n,z)={for (i=1,n,z=deriv(z));z}
default(format,"g0.14")
print ("360th derivative at 0.5: "subst(dnz(360,xsexp),x,0.5));
360th derivative at 0.5: 2.1356744655704 E621
- Sheldon

