The function may be called by the names: s01bac, nag_specfun_log_shifted or nag_shifted_log.
3Description
s01bac computes values of , retaining full relative precision even when is small. The function is based on the Chebyshev expansion
Setting , and choosing , the expansion is valid in the domain .
Outside this domain, is computed by the standard logarithmic function.
4References
Lyusternik L A, Chervonenkis O A and Yanpolskii A R (1965) Handbook for Computing Elementary Functions p. 57 Pergamon Press
5Arguments
1: – doubleInput
On entry: the argument of the function.
Constraint:
.
2: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_REAL_ARG_LE
On entry, .
Constraint: .
7Accuracy
The returned result should be accurate almost to machine precision, with a limit of about significant figures due to the precision of internal constants. Note however, that if lies very close to and is not exact (for example if is the result of some previous computation and has been rounded), then precision will be lost in the computation of , and hence , in s01bac.
8Parallelism and Performance
s01bac is not threaded in any implementation.
9Further Comments
Empirical tests show that the time taken for a call of s01bac usually lies between about and times the time for a call to the standard logarithm function.
10Example
The example program reads values of the argument from a file, evaluates the function at each value of and prints the results.