Hi Regina,

On Monday, 2008-12-22 00:09:02 +0100, Regina Henschel wrote:

> Merry Christmas and a happy New Year to you.

Well, yes, same to you!

>>> (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 ;-)
>
> In general they are, but to test, which cut value to use and how many  
> summands are needed, is tedious. If there will be a reason for to make  
> the solution independed of log1p, the algorithm can be changed.

Of course. The "test, which cut value to use and how many summands are
needed, is tedious" however really makes me believe we should go for #1.

>   I think #1
>> would be best, for simplicity.
>
> I have used (1)

Fine.

>  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.
>
> I found no difference in performance.

Great. If simplicity doesn't have drawbacks this is the way to go.

>>> 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
>
> It is issue 97467. Although I do not really understand the things you  
> have done for expm1 and log1p,

No magic involved..  Having added them as rtl_math_...() functions
exported as "C" makes them usable also in plain C programs (remember,
sal is part of the UDK/SDK). The inlines in math.hxx add namespace for
C++. The .map entries specify the functions are to be exported from the
sal library, making them available for linkage with other modules. The
section UDK_3.9 is for symbol versioning, as the UDK may be used
independently of OOo or with different releases of OOo it might happen
that different versions of libsal are around, this tells the runtime
linker what to look for. Well, certainly not an accurate description,
but basically that's what it is about.

> I have tried to mimic them.

Looks good from a first glance.

> Perhaps when  
> code freeze is over, you have some time to explain it?

The benefits of vacation are that one can do whatever one pleases :-)

> The related changes for ATANH, FISHER and FISHERINV are in issue 97468.

Thanks, I'll schedule them for OOo3.1 and add a dependency to the
changes in sal.

> A quick look at ASINH shows, that it has similar deficiencies. But that  
> will be a new project.

Never ending these things..

  Eike

-- 
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD

Attachment: pgpfxYybleOWW.pgp
Description: PGP signature

Reply via email to