~dinko-metalac/calculus-app2/trunk

« back to all changes in this revision

Viewing changes to lib/py/sympy/mpmath/tests/test_fp.py

  • Committer: dinko.metalac at gmail
  • Date: 2015-04-14 13:28:14 UTC
  • Revision ID: dinko.metalac@gmail.com-20150414132814-j25k3qd7sq3warup
new sympy

Show diffs side-by-side

added added

removed removed

Lines of Context:
335
335
    assert ae(fp.lambertw(-3-4j, 2), (-0.55792273874679112639 + 8.7173627024159324811j))
336
336
    assert ae(fp.lambertw(10000+1000j, 2), (6.6223802254585662734 + 11.61348646825020766j))
337
337
 
338
 
# This function has to be split because it is too long for Jython.
339
 
# See http://grinder.sourceforge.net/faq.html#faq-N10544.
340
 
 
341
 
def test_fp_stress_ei_e1_1():
 
338
def test_fp_stress_ei_e1():
342
339
    # Can be tightened on recent Pythons with more accurate math/cmath
343
340
    ATOL = 1e-13
344
341
    PTOL = 1e-12
596
593
    assert ae(v, (5855431.4907298084434 - 720920.93315409165707j), tol=ATOL)
597
594
    assert ae(v.real, 5855431.4907298084434, tol=PTOL)
598
595
    assert ae(v.imag, -720920.93315409165707, tol=PTOL)
599
 
 
600
 
 
601
 
def test_fp_stress_ei_e1_2():
602
 
    # Can be tightened on recent Pythons with more accurate math/cmath
603
 
    ATOL = 1e-13
604
 
    PTOL = 1e-12
605
 
 
606
596
    v = fp.e1((-30.0 + 120.0j))
607
597
    assert ae(v, (-65402491644.703470747 - 56697658399.657460294j), tol=ATOL)
608
598
    assert ae(v.real, -65402491644.703470747, tol=PTOL)
1022
1012
    v = fp.ei(1.1641532182693481445e-10)
1023
1013
    assert ae(v, -22.296641293460247028, tol=ATOL)
1024
1014
    assert type(v) is float
1025
 
 
1026
 
def test_fp_stress_ei_e1_3():
1027
 
    # Can be tightened on recent Pythons with more accurate math/cmath
1028
 
    ATOL = 1e-13
1029
 
    PTOL = 1e-12
1030
 
 
1031
1015
    v = fp.ei(0.25)
1032
1016
    assert ae(v, -0.54254326466191372953, tol=ATOL)
1033
1017
    assert type(v) is float