예제 #1
0
 def test_airyai_prime(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [Arg(-1e8, 1e8)], 
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [Arg(-1e3, 1e3)])
예제 #2
0
 def test_airyai_prime(self):
     # oscillating function, limit range
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [Arg(-1e8, 1e8)],
                         rtol=1e-6)
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [Arg(-1e3, 1e3)])
예제 #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))
예제 #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))
예제 #5
0
def f6(x):
    # airy_Ai_deriv_scaled
    scale = mpmath.exp(mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airyai(x, derivative=1)
    if x > 0.0:
        y = y * scale
    return y
예제 #6
0
def f2(x):
    # airy_Ai_scaled
    scale = mpmath.exp(mpmath.mpf(2) / mpmath.mpf(3) * mpmath.sqrt(x) * x)
    y = mpmath.airyai(x)
    if x > 0.0:
        y = y * scale
    return y
예제 #7
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airyai(x, derivative=1)
예제 #8
0
 def test_airyai_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z:
                         mpmath.airyai(z, derivative=1),
                         [ComplexArg()])
예제 #9
0
 def test_airyai_prime_complex(self):
     assert_mpmath_equal(lambda z: sc.airy(z)[1],
                         lambda z: mpmath.airyai(z, derivative=1),
                         [ComplexArg()])
예제 #10
0
def f0(x):
    # airy_Ai
    return mpmath.airyai(x)
예제 #11
0
def f4(x):
    # airy_Ai_deriv
    return mpmath.airyai(x, derivative=1)
예제 #12
0
 def get_mpmath_function(self, args):
     return lambda x: mpmath.airyai(x, derivative=1)