24ab1bff71d480227cb7a7de1d7ef34d0c0fcad2,mathics/builtin/arithmetic.py,_MPMathFunction,apply,#_MPMathFunction#Any#Any#,43

Before Change


            result = from_sympy(result)
            // evaluate leaves to convert e.g. Plus[2, I] -> Complex[2, 1]
            result = result.evaluate_leaves(evaluation)
        elif mpmath_function is not None:
            prec = min_prec(*args)
            with mpmath.workprec(prec):
                sympy_args = [x.to_sympy() for x in args]
                if None in sympy_args:
                    return
                mpmath_args = [sympy2mpmath(x, prec) for x in sympy_args]
                if None in mpmath_args:
                    return
                try:
                    result = self.get_mpmath_function(mpmath_args)(*mpmath_args)
                    result = from_sympy(mpmath2sympy(result, prec))
                except ValueError as exc:
                    text = str(exc)
                    if text == "gamma function pole":
                        return Symbol("ComplexInfinity")
                    else:
                        raise
                except ZeroDivisionError:
                    return

After Change


                return

            result = self.call_mpmath(mpmath_function, float_args)
            if isinstance(result, (mpmath.mpc, mpmath.mpf)):
                result = Number.from_mp(result)
        else:
            prec = min_prec(*args)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: mathics/Mathics
Commit Name: 24ab1bff71d480227cb7a7de1d7ef34d0c0fcad2
Time: 2016-08-05
Author: 16sn6uv@gmail.com
File Name: mathics/builtin/arithmetic.py
Class Name: _MPMathFunction
Method Name: apply


Project Name: brian-team/brian2
Commit Name: deaaa97e22c78c64fc9e446f28608cc37191f3c9
Time: 2013-05-10
Author: marcel.stimberg@ens.fr
File Name: brian2/stateupdaters/explicit.py
Class Name: ExplicitStateUpdater
Method Name: __call__


Project Name: mathics/Mathics
Commit Name: e56f91c9b60f561712d28faae3e4d047adc67760
Time: 2016-09-14
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/importexport.py
Class Name: Import
Method Name: apply