Re: [sc-dev] precision of GAMMALN

```Hi Eike,

Eike Rathke schrieb:
```
`Hi Regina,`
```
On Monday, 2008-03-10 18:15:29 +0100, Regina Henschel wrote:

```
```significant digits. I looked around for some better coefficient and
found them in Apache Library

Are we allowed to use this values?
```
```
You mean to use only the coefficient values?
```
```
```
Yes, I mean the pure values. Problem is, that although Paul Godfrey shows a way to calculate such coefficients, you need to calculate a lot of tables with high precision to get _good_ coefficients.
```http://home.att.net/~numericana/answer/info/godfrey.htm

I have no idea whether
```
```coefficient values could be copyrighted or fall under the same license
the source code is licensed, and of course IANAL, so I can't give any
```
```
Do you know someone to ask?

```
```
```
```The result would be excellent. If you compare in a Calc cell the values
calculated with GAMMALN with the directly calculated values (which is
possible for GAMMALN(n) and GAMMALN(n+0.5) with positive integer n) you
will get TRUE.
```
```
Sounds nice, but ...

Btw, do you happen to know the Cephes library?
```
```
No, I didn't.

```
It also has gamma (didn't test, could you take a look at it?) among other nice algorithms, and is
```said to be numerically accurate, several other software products use it
as well. See http://www.moshier.net/#Cephes
```
```
```
I have downloaded it and have a quick glance on it. It divides the problem in two cases, one is approximated with a polynom, the other with Stirlings formula. I will need some time to understand in detail, how it works, before I will be able to adapt it to OOo. The algorithm is more complex than the solution with the Lanczos approximation.
```
```
Can you point me to an ready implementation to test it, before I start to become acquainted with it?
```
```
```
I currently favour that library, it looks like it could solve our
numerical stability problems, and maybe more. Unfortunately the license
is somewhat unclear, respectively there's just a "may be used freely"
statement. I'll get in contact with Steve and see whether we can arrange
something for the legal department.
```
```
```
BTW: I have come across the gamma function when looking at issue 86294. Unfortunately a precise gamma function doesn't solve it. Is 86294 another candidate for issue 18704?
```
kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

```