The function may be called by the names: s01bac, nag_specfun_log_shifted or nag_shifted_log.
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.
Lyusternik L A, Chervonenkis O A and Yanpolskii A R (1965) Handbook for Computing Elementary Functions p. 57 Pergamon Press
1: – doubleInput
On entry: the argument of the function.
2: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
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.
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.
On entry, .
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
Background information to multithreading can be found in the Multithreading documentation.
s01bac is not threaded in any implementation.
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.
The example program reads values of the argument from a file, evaluates the function at each value of and prints the results.