(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)
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)
Evaluate the given formula to an accuracy of n digits.
        Optional keyword arguments:
Evaluate the given formula to an accuracy of n digits . Optional keyword arguments :
def evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False):
        """
        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)

        """
        # for sake of sage that doesn't like evalf(1)
        if n == 1 and isinstance(self, C.Number):
            from sympy.core.expr import _mag
            rv = self.evalf(2, subs, maxn, chop, strict, quad, verbose)
            m = _mag(rv)
            rv = rv.round(1 - m)
            return rv

        if not evalf_table:
            _create_evalf_table()
        prec = dps_to_prec(n)
        options = {'maxprec': max(prec, int(maxn*LG10)), 'chop': chop,
               'strict': strict, 'verbose': verbose}
        if subs is not None:
            options['subs'] = subs
        if quad is not None:
            options['quad'] = quad
        try:
            result = evalf(self, prec + 4, options)
        except NotImplementedError:
            # Fall back to the ordinary evalf
            v = self._eval_evalf(prec)
            if v is None:
                return self
            try:
                # If the result is numerical, normalize it
                result = evalf(v, prec, options)
            except NotImplementedError:
                # Probably contains symbols or unknown functions
                return v
        re, im, re_acc, im_acc = result
        if re:
            p = max(min(prec, re_acc), 1)
            #re = mpf_pos(re, p, rnd)
            re = C.Float._new(re, p)
        else:
            re = S.Zero
        if im:
            p = max(min(prec, im_acc), 1)
            #im = mpf_pos(im, p, rnd)
            im = C.Float._new(im, p)
            return re + im*S.ImaginaryUnit
        else:
            return re
def evalf ( self , n = 15 , subs = None , maxn = 100 , chop = False , strict = False , quad = None , verbose = False ) : # for sake of sage that doesn't like evalf(1) if n == 1 and isinstance ( self , C . Number ) : from sympy . core . expr import _mag rv = self . evalf ( 2 , subs , maxn , chop , strict , quad , verbose ) m = _mag ( rv ) rv = rv . round ( 1 - m ) return rv if not evalf_table : _create_evalf_table ( ) prec = dps_to_prec ( n ) options = { 'maxprec' : max ( prec , int ( maxn * LG10 ) ) , 'chop' : chop , 'strict' : strict , 'verbose' : verbose } if subs is not None : options [ 'subs' ] = subs if quad is not None : options [ 'quad' ] = quad try : result = evalf ( self , prec + 4 , options ) except NotImplementedError : # Fall back to the ordinary evalf v = self . _eval_evalf ( prec ) if v is None : return self try : # If the result is numerical, normalize it result = evalf ( v , prec , options ) except NotImplementedError : # Probably contains symbols or unknown functions return v re , im , re_acc , im_acc = result if re : p = max ( min ( prec , re_acc ) , 1 ) #re = mpf_pos(re, p, rnd) re = C . Float . _new ( re , p ) else : re = S . Zero if im : p = max ( min ( prec , im_acc ) , 1 ) #im = mpf_pos(im, p, rnd) im = C . Float . _new ( im , p ) return re + im * S . ImaginaryUnit else : return re