![](https://secure.gravatar.com/avatar/d41fa6e1fe29e6c5c5821b5a3f31f190.jpg?s=120&d=mm&r=g)
Stephen Walton wrote:
Nils Wagner wrote:
Hi all,
Is it somehow possible to improve the accuracy of derivative ?
Higher order?
from scipy import *
def func(x): return exp(2*x)
for i in arange(1,6): d=derivative(func,0.0,dx,i,order=9) print i,' derivative of exp(2*x) at x=0',d,'exact',2**i print ' rel error %e' % (d/2**i - 1)
Changing the order to 9 improves the accuracy of the 6th derivative from 1e-4 to 3e-7.
The problem is that I need very accurate results, since I want to use them as an input of cof in SUBROUTINE pade (see my previous E-mail Pade Approximants). cof contains the leading terms of the power series expansion of a function. Nils
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user