![]() |
(git:b77b4be)
|
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]. More...
Functions/Subroutines | |
subroutine, public | check_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. | |
subroutine, public | get_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. | |
subroutine, public | validate_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. | |
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].
This module is an extension of original minimax module minimax_exp_k15 (up to K = 15) to provide minimax approximations for larger ranges Rc (up to K = 53).
k53 implementation is based on directly tabulated coefficients from D. Braess and W. Hackbusch, IMA Journal of Numerical Analysis 25.4 (2005): 685-697 http://www.mis.mpg.de/scicomp/EXP_SUM/1_x
Note: Due to discrete Rc values, the k53 implementation does not yield optimal approximations for arbitrary Rc. If optimal minimax coefficients are needed, the minimax_exp_k15 module should be extended by interpolating k53 coefficients.
subroutine, public minimax_exp::check_exp_minimax_range | ( | integer, intent(in) | k, |
real(kind=dp), intent(in) | rc, | ||
integer, intent(out) | 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.
k | ... |
Rc | ... |
ierr | ... |
Definition at line 100 of file minimax_exp.F.
subroutine, public minimax_exp::get_exp_minimax_coeff | ( | integer, intent(in) | k, |
real(kind=dp), intent(in) | rc, | ||
real(kind=dp), dimension(2*k), intent(out) | aw, | ||
real(kind=dp), intent(out), optional | mm_error, | ||
integer, intent(out), optional | 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.
k | Number of minimax terms |
Rc | Minimax range |
aw | 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. |
mm_error | Numerical error of minimax approximation for given k, Rc |
which_coeffs | Whether the coefficients returned have been generated from k15 or k53 coefficients (mm_k15 or mm_k53). |
Definition at line 126 of file minimax_exp.F.
subroutine, public minimax_exp::validate_exp_minimax | ( | integer, intent(in) | n_r, |
integer, intent(in) | iw | ||
) |
Unit test checking that numerical error of minimax approximations generated using any k15 or k53 coefficients is consistent with tabulated error.
n_R | Number of Rc values to be tested. |
iw | ... |
Definition at line 245 of file minimax_exp.F.