Hi Regina,

On Wednesday, 2008-12-17 16:22:09 +0100, Regina Henschel wrote:

> 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.

I trust you that the results would be identical ;-)  I think #1
would be best, for simplicity. You could also profile some ten thousand
calls or so with a sample range of values to determine if any of the two
approaches would have significant performance benefits over the other.

> 1. Should atanh be implemented to ::rtl::math like it has been done for  
> log1p and expm1?

Yes, that would be cleanest. Please file an issue similar to i97091

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9 F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
 Please don't send personal mail to the [email protected] account, which I use for
 mailing lists only and don't read from outside Sun. Use [email protected] Thanks.

Attachment: pgpOwu9P8kXCK.pgp
Description: PGP signature

Reply via email to