The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 2 | /* |
| 3 | * ==================================================== |
| 4 | * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. |
| 5 | * |
| 6 | * Developed at SunSoft, a Sun Microsystems, Inc. business. |
| 7 | * Permission to use, copy, modify, and distribute this |
| 8 | * software is freely granted, provided that this notice |
| 9 | * is preserved. |
| 10 | * ==================================================== |
| 11 | * |
| 12 | */ |
| 13 | |
Elliott Hughes | 4088e3a | 2023-08-03 13:33:56 -0700 | [diff] [blame] | 14 | /* lgamma(x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | * Return the logarithm of the Gamma function of x. |
| 16 | * |
Elliott Hughes | 4088e3a | 2023-08-03 13:33:56 -0700 | [diff] [blame] | 17 | * Method: call lgamma_r |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 18 | */ |
| 19 | |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 20 | #include <float.h> |
| 21 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 22 | #include "math.h" |
| 23 | #include "math_private.h" |
| 24 | |
| 25 | extern int signgam; |
| 26 | |
| 27 | double |
Elliott Hughes | 4088e3a | 2023-08-03 13:33:56 -0700 | [diff] [blame] | 28 | lgamma(double x) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | { |
Elliott Hughes | 4088e3a | 2023-08-03 13:33:56 -0700 | [diff] [blame] | 30 | return lgamma_r(x,&signgam); |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | } |
Elliott Hughes | 7553185 | 2014-09-18 11:23:58 -0700 | [diff] [blame] | 32 | |
| 33 | #if (LDBL_MANT_DIG == 53) |
| 34 | __weak_reference(lgamma, lgammal); |
| 35 | #endif |