Documentation for module minimax_exp

Routines to calculate the minimax coefficients in order to approximate 1/x as a sum over exponential functions 1/x ~ SUM_{i}^{K} w_i EXP(-a_i * x) for x belonging to [1:Rc].

source: minimax_exp.F
Loading...

public Subroutines/Functions:

Check that a minimax approximation is available for given input k, Rc. ierr == 0: everything ok ierr == 1: Rc too small ierr == -1: k too large
Get best minimax approximation for given input parameters. Automatically chooses the most exact set of minimax coefficients (k15 or k53) for given k, Rc.
Unit test checking that numerical error of minimax approximations generated using any k15 or k53 coefficients is consistent with tabulated error.

SUBROUTINEcheck_exp_minimax_range(k, rc, ierr)

Check that a minimax approximation is available for given input k, Rc. ierr == 0: everything ok ierr == 1: Rc too small ierr == -1: k too large

Arguments:
INTEGER,
INTENT(in)
:: k ...
REAL(dp),
INTENT(in)
:: rc ...
INTEGER,
INTENT(out)
:: ierr ...

SUBROUTINEget_exp_minimax_coeff(k, rc, aw, mm_error, which_coeffs)

Get best minimax approximation for given input parameters. Automatically chooses the most exact set of minimax coefficients (k15 or k53) for given k, Rc.

Arguments:
INTEGER,
INTENT(in)
:: k Number of minimax terms
REAL(dp),
INTENT(in)
:: rc Minimax range
REAL(dp),
INTENT(out)
:: aw(2*k) The a_i and w_i coefficient are stored in aw such that the first 1:K elements correspond to a_i and the K+1:2k correspond to w_i.
REAL(dp),
INTENT(out),
OPTIONAL
:: mm_error Numerical error of minimax approximation for given k, Rc
INTEGER,
INTENT(out),
OPTIONAL
:: which_coeffs Whether the coefficients returned have been generated from k15 or k53 coefficients (mm_k15 or mm_k53).

SUBROUTINEvalidate_exp_minimax(n_r, iw)

Unit test checking that numerical error of minimax approximations generated using any k15 or k53 coefficients is consistent with tabulated error.

Arguments:
INTEGER,
INTENT(in)
:: n_r Number of Rc values to be tested.
INTEGER,
INTENT(in)
:: iw ...