"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "mpmath/identification.py" between
mpmath-1.0.0.tar.gz and mpmath-1.1.0.tar.gz

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

identification.py  (mpmath-1.0.0):identification.py  (mpmath-1.1.0)
skipping to change at line 534 skipping to change at line 534
(lambda ctx,x,c: ctx.ln(x*c), 'exp($y)/$c', 0), (lambda ctx,x,c: ctx.ln(x*c), 'exp($y)/$c', 0),
(lambda ctx,x,c: ctx.ln(x/c), '$c*exp($y)', 1), (lambda ctx,x,c: ctx.ln(x/c), '$c*exp($y)', 1),
(lambda ctx,x,c: ctx.ln(c/x), '$c/exp($y)', 0), (lambda ctx,x,c: ctx.ln(c/x), '$c/exp($y)', 0),
(lambda ctx,x,c: c*ctx.ln(x), 'exp($y/$c)', 1), (lambda ctx,x,c: c*ctx.ln(x), 'exp($y/$c)', 1),
(lambda ctx,x,c: ctx.ln(x)/c, 'exp($c*$y)', 1), (lambda ctx,x,c: ctx.ln(x)/c, 'exp($c*$y)', 1),
(lambda ctx,x,c: c/ctx.ln(x), 'exp($c/$y)', 0), (lambda ctx,x,c: c/ctx.ln(x), 'exp($c/$y)', 0),
] ]
def identify(ctx, x, constants=[], tol=None, maxcoeff=1000, full=False, def identify(ctx, x, constants=[], tol=None, maxcoeff=1000, full=False,
verbose=False): verbose=False):
""" r"""
Given a real number `x`, ``identify(x)`` attempts to find an exact Given a real number `x`, ``identify(x)`` attempts to find an exact
formula for `x`. This formula is returned as a string. If no match formula for `x`. This formula is returned as a string. If no match
is found, ``None`` is returned. With ``full=True``, a list of is found, ``None`` is returned. With ``full=True``, a list of
matching formulas is returned. matching formulas is returned.
As a simple example, :func:`~mpmath.identify` will find an algebraic As a simple example, :func:`~mpmath.identify` will find an algebraic
formula for the golden ratio:: formula for the golden ratio::
>>> from mpmath import * >>> from mpmath import *
>>> mp.dps = 15; mp.pretty = True >>> mp.dps = 15; mp.pretty = True
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)