Hi,
I have examined FISHER and FISHERINV and thereby struggle about some
problems.
FISHERINV(x) is not accurate for x very near to zero. For example
FISHERINV(1E-15)=1.00001387379200E-015, but should result in 1E-15. That
can be easily fixed by calling tanh() instead of the current
(exp(2x)-1)/(exp(2x)+1).
FISHER has the same problem for x near zero. For example
FISHER(0.00001)=1.00000000002953E-005, but should return
1.00000000003333E-005. The fix is easy but needs some decisions.
Mathematically FISHER(x)=atanh(x). But the OOo function ATANH() uses the
same insufficient algorithm as FISHER. Therefore ATANH() has to be
changed too. The best solution, using a build-in function, is not
available: atanh() is a C99 function and therefore not available in MSVC
compiler. The code itself is rather simple, there are two possible methods:
(1) atanh(x)=0.5*log1p(2*x/(1-x))
(2) Use the first five summands of the power series for |x|<0.01, which
would be atanh(x)=x(1+x²*(1/3+x²*(1/5+x²*(1/7+x²*1/9)))) and use
atanh(x)=0.5*ln((1+x)/(1-x)) in the other cases.
Two decisions are needed
1. Should atanh be implemented to ::rtl::math like it has been done for
log1p and expm1?
2. Which of the two methods should be used.
Please instruct me.
kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org