Example #1
0
 def test_airybi(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[2],
                         lambda z: mpmath.airybi(z), [Arg(-1e8, 1e8)],
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[2],
                         lambda z: mpmath.airybi(z), [Arg(-1e3, 1e3)])
Example #2
0
 def test_airybi_prime(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[3], lambda z:
                         mpmath.airybi(z, derivative=1),
                         [Arg(-1e8, 1e8)],
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[3], lambda z:
                         mpmath.airybi(z, derivative=1),
                         [Arg(-1e3, 1e3)])
Example #3
0
def make_airy_vals():
    from mpmath import airyai, airybi

    x = linspace(-5, 15, 21)
    ai = [airyai(val) for val in x]
    aip = [airyai(val, 1) for val in x]
    bi = [airybi(val) for val in x]
    bip = [airybi(val, 1) for val in x]

    aibi = zip(zip(ai, aip), zip(bi, bip))

    return make_special_vals('airy_vals', ('x', x), ('aibi', aibi))
Example #4
0
def make_airy_vals():
    from mpmath import airyai, airybi

    x = linspace(-5, 15, 21)
    ai = [airyai(val) for val in x]
    aip = [airyai(val, 1) for val in x]
    bi = [airybi(val) for val in x]
    bip = [airybi(val, 1) for val in x]

    aibi = list(zip(list(zip(ai, aip)), list(zip(bi, bip))))

    return make_special_vals('airy_vals', ('x', x), ('aibi', aibi))
def f7(x):
    # airy_Bi_deriv_scaled
    scale = mpmath.exp(-mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airybi(x, derivative=1)
    if x > 0.0:
        y = y * scale
    return y
def f3(x):
    # airy_Bi_scaled
    scale = mpmath.exp(-mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airybi(x)
    if x > 0.0:
        y = y * scale
    return y
Example #7
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airybi(x, derivative=1)
Example #8
0
 def test_airybi_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[3], lambda z:
                         mpmath.airybi(z, derivative=1),
                         [ComplexArg()])
Example #9
0
 def test_airybi_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[2], lambda z:
                         mpmath.airybi(z),
                         [ComplexArg()])
Example #10
0
 def test_airybi_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[3],
                         lambda z: mpmath.airybi(z, derivative=1),
                         [ComplexArg()])
Example #11
0
 def test_airybi_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[2],
                         lambda z: mpmath.airybi(z), [ComplexArg()])
def f5(x):
    # airy_Bi_deriv
    return mpmath.airybi(x, derivative=1)
def f1(x):
    # airy_Bi
    return mpmath.airybi(x)
Example #14
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airybi(x, derivative=1)