(self, z0)
return Expr._from_mpmath(mpmath.diff(eval,
                                             z0._to_mpmath(mpmath.mp.prec)),
                                 mpmath.mp.prec)
Evaluate the derivative at z numerically.

        When we can represent derivatives at a point, this should be folded
        into the normal evalf. For now, we need a special method.
Evaluate the derivative at z numerically.
Evaluate the derivative at z numerically .
def doit_numerically(self, z0):
        """
        Evaluate the derivative at z numerically.

        When we can represent derivatives at a point, this should be folded
        into the normal evalf. For now, we need a special method.
        """
        from sympy import mpmath
        from sympy.core.expr import Expr
        if len(self.free_symbols) != 1 or len(self.variables) != 1:
            raise NotImplementedError('partials and higher order derivatives')
        z = list(self.free_symbols)[0]

        def eval(x):
            f0 = self.expr.subs(z, Expr._from_mpmath(x, prec=mpmath.mp.prec))
            f0 = f0.evalf(mlib.libmpf.prec_to_dps(mpmath.mp.prec))
            return f0._to_mpmath(mpmath.mp.prec)
        return Expr._from_mpmath(mpmath.diff(eval,
                                             z0._to_mpmath(mpmath.mp.prec)),
                                 mpmath.mp.prec)
def doit_numerically ( self , z0 ) : from sympy import mpmath from sympy . core . expr import Expr if len ( self . free_symbols ) != 1 or len ( self . variables ) != 1 : raise NotImplementedError ( 'partials and higher order derivatives' ) z = list ( self . free_symbols ) [ 0 ] def eval ( x ) : f0 = self . expr . subs ( z , Expr . _from_mpmath ( x , prec = mpmath . mp . prec ) ) f0 = f0 . evalf ( mlib . libmpf . prec_to_dps ( mpmath . mp . prec ) ) return f0 . _to_mpmath ( mpmath . mp . prec ) return Expr . _from_mpmath ( mpmath . diff ( eval , z0 . _to_mpmath ( mpmath . mp . prec ) ) , mpmath . mp . prec )