nag_specfun_log_shifted (s01ba) 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
.
None.
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
nag_specfun_log_shifted (s01ba).
function s01ba_example
fprintf('s01ba example results\n\n');
x = [2.5 1.25e-1 -9.06e-1 1.29e-3 -7.83e-6 1.00e-9];
n = size(x,2);
result = x;
for j=1:n
[result(j), ifail] = s01ba(x(j));
end
disp(' x log(1+x)');
fprintf('%12.4e%12.4e\n',[x; result]);