37,720
社区成员
发帖
与我相关
我的任务
分享
In [356]: diff1 = sympy.diff(f, x)
In [357]: diff1
Out[357]: 3*x**2 + 2*x
In [358]: diff1.evalf(15, {x: 1})
Out[358]: 5.00000000000000
In [359]: diff1.evalf?
Type: instancemethod
String Form:<bound method Add.evalf of 3*x**2 + 2*x>
File: /usr/lib/python2.7/dist-packages/sympy/core/evalf.py
Definition: diff1.evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)
Docstring:
Evaluate the given formula to an accuracy of n digits.
Optional keyword arguments:
subs=<dict>
Substitute numerical values for symbols, e.g.
subs={x:3, y:1+pi}.
maxn=<integer>
Allow a maximum temporary working precision of maxn digits
(default=100)
chop=<bool>
Replace tiny real or imaginary parts in subresults
by exact zeros (default=False)
strict=<bool>
Raise PrecisionExhausted if any subresult fails to evaluate
to full accuracy, given the available maxprec
(default=False)
quad=<str>
Choose algorithm for numerical quadrature. By default,
tanh-sinh quadrature is used. For oscillatory
integrals on an infinite interval, try quad='osc'.
verbose=<bool>
Print debug information (default=False)