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