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)])
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))
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 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
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
def get_mpmath_function(self, args): return lambda x: mpmath.airyai(x, derivative=1)
def test_airyai_prime_complex(self): assert_mpmath_equal(lambda z: sc.airy(z)[1], lambda z: mpmath.airyai(z, derivative=1), [ComplexArg()])
def f0(x): # airy_Ai return mpmath.airyai(x)
def f4(x): # airy_Ai_deriv return mpmath.airyai(x, derivative=1)