airyAi

Evaluates the Airy function.

Synopsis

airyAi (x)

Required Arguments

float x (Input)
Argument for which the function value is desired.

Return Value

The Airy function evaluated at x, Ai(x).

Description

The airy function Ai(x) is defined to be

\[Ai(x) = \tfrac{1}{\pi} \int_0^{\infty} \cos \left(xt + \tfrac{1}{3} t^3\right) dt = \sqrt{\frac{x}{3\pi^2}} K_{1/3} \left(\tfrac{2}{3} x^{3/2}\right)\]

The Bessel function \(K_v(x)\) is defined in besselExpK0.

If \(x<-1.31 \varepsilon^{-2/3}\), then the answer will have no precision. If \(x<-1.31 \varepsilon^{-1/3}\), the answer will be less accurate than half precision. Here ɛ = machine(4) is the machine precision.

Finally, x should be less than \(x_{max}\) so the answer does not underflow. Very approximately, \(x_{max}=\{-1.5 \ln s \}^{2/3}\), where s = machine(1), the smallest representable positive number.

For more information, see the description for machine.

Example

In this example, Ai(-4.9) is evaluated.

from __future__ import print_function
from numpy import *
from pyimsl.math.airyAi import airyAi

x = -4.9
ans = airyAi(x)
print("Ai(-4.9) = %f" % (ans))

Output

Ai(-4.9) = 0.374536