-
real(dl)
airy_ai_fast(x)
Fast real Airy Ai(x), optimized for < 5e-8 absolute error.
Ai-only version of airy_fast. Uses the same branch cuts, Ai polynomial
coefficients, and simplified asymptotic fallbacks. The coefficients are
duplicated verbatim rather than shared, to keep both routines branch-free
of any present(aip) test on the hot path; a refit must update airy_fast
too. camb.tests.mathutils_test checks the two agree to round-off.
Maximum absolute Ai error is about 4.9e-08 on [-6.5,6.5]. On [-50,-6.5) and
(6.5,25.77], the corresponding asymptotic-branch max absolute Ai errors
are about 2.3e-08 and 7.9e-10. Relative errors can be large near zeros;
absolute error is the intended accuracy diagnostic.
-
real(dl) intent(in) :: x
real(dl)
airy_p1evl(x, coef)
real(dl) intent(in) :: x
real(dl) intent(in) :: coef(:)
real(dl)
airy_polevl(x, coef)
real(dl) intent(in) :: x
real(dl) intent(in) :: coef(:)
real(dl)
GetChiSquared(n, Y, c_inv)
get dot_product(matmul(C_inv,Y), Y) efficiently assuming c_inv symmetric
integer intent(in) :: n
real(dl) intent(in) :: Y(n)
real(dl) intent(in) :: c_inv(n, n)
real(dl)
Integrate_Romberg(obj, f, a, b, tol, maxit, minsteps, abs_tol)
Rombint returns the integral from a to b of f(obj,x) using Romberg integration.
The method converges provided that f is continuous in (a,b).
f must be real(dl). The first argument is a class instance.
tol indicates the desired relative accuracy in the integral.
Modified by AL to specify max iterations and minimum number of steps
(min steps useful to stop wrong results on periodic or sharp functions)
class(*) :: obj
procedure(obj_function) :: f f(obj, x), unwrapping obj with select type
real(dl) intent(in) :: a
real(dl) intent(in) :: b
real(dl) intent(in) :: tol
integer intent(in), optional :: maxit
integer intent(in), optional :: minsteps
logical intent(in), optional :: abs_tol
real(dl)
Newton_Raphson2(xxl, xxh, funcs, param, param2)
real(dl) intent(in) :: xxl root bracket 1
real(dl) intent(in) :: xxh root bracket 2
external :: funcs subroutine for non-linear equation
real(dl) intent(in) :: param parameters for function
real(dl) intent(in) :: param2 parameters for function
real(dl)
obj_function(obj, x)
Callback taking an arbitrary class instance; the callback does select type on obj.
class(*) :: obj
real(dl) intent(in) :: x