"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpmath/calculus/differentiation.py" between
mpmath-0.18.tar.gz and mpmath-0.19.tar.gz

About: mpmath is a Python library for arbitrary-precision floating-point arithmetic.

differentiation.py  (mpmath-0.18):differentiation.py  (mpmath-0.19)
skipping to change at line 618 skipping to change at line 618
>>> p, q = pade(a, 3, 3) >>> p, q = pade(a, 3, 3)
>>> x = 10 >>> x = 10
>>> polyval(p[::-1], x)/polyval(q[::-1], x) >>> polyval(p[::-1], x)/polyval(q[::-1], x)
1.38169105566806 1.38169105566806
>>> f(x) >>> f(x)
1.38169855941551 1.38169855941551
""" """
# To determine L+1 coefficients of P and M coefficients of Q # To determine L+1 coefficients of P and M coefficients of Q
# L+M+1 coefficients of A must be provided # L+M+1 coefficients of A must be provided
assert(len(a) >= L+M+1) if len(a) < L+M+1:
raise ValueError("L+M+1 Coefficients should be provided")
if M == 0: if M == 0:
if L == 0: if L == 0:
return [ctx.one], [ctx.one] return [ctx.one], [ctx.one]
else: else:
return a[:L+1], [ctx.one] return a[:L+1], [ctx.one]
# Solve first # Solve first
# a[L]*q[1] + ... + a[L-M+1]*q[M] = -a[L+1] # a[L]*q[1] + ... + a[L-M+1]*q[M] = -a[L+1]
# ... # ...
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS