For targets that have a signed zero, lgamma_r(-0, &signgamp) should
set signgamp = -1. Submitted by: enh at google dot com (e_lgamma[f]_r.c)
This commit is contained in:
parent
21cffce593
commit
f382031d34
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=271719
@ -241,7 +241,11 @@ lgammal_r(long double x, int *signgamp)
|
||||
*signgamp = 1;
|
||||
if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */
|
||||
return x*x;
|
||||
if((hx==0||hx==0x8000)&&lx==0) return one/vzero;
|
||||
if((hx==0||hx==0x8000)&&lx==0) {
|
||||
if (hx&0x8000)
|
||||
*signgamp = -1;
|
||||
return one/vzero;
|
||||
}
|
||||
|
||||
/* purge off tiny and negative arguments */
|
||||
if(fabsl(x)<0x1p-119L) {
|
||||
|
@ -261,7 +261,11 @@ lgammal_r(long double x, int *signgamp)
|
||||
*signgamp = 1;
|
||||
if((hx & 0x7fff) == 0x7fff) /* x is +-Inf or NaN */
|
||||
return x*x;
|
||||
if((hx==0||hx==0x8000)&&lx==0) return one/vzero;
|
||||
if((hx==0||hx==0x8000)&&lx==0) {
|
||||
if (hx&0x8000)
|
||||
*signgamp = -1;
|
||||
return one/vzero;
|
||||
}
|
||||
|
||||
ENTERI();
|
||||
|
||||
|
@ -214,7 +214,11 @@ __ieee754_lgamma_r(double x, int *signgamp)
|
||||
*signgamp = 1;
|
||||
ix = hx&0x7fffffff;
|
||||
if(ix>=0x7ff00000) return x*x;
|
||||
if((ix|lx)==0) return one/vzero;
|
||||
if((ix|lx)==0) {
|
||||
if(hx<0)
|
||||
*signgamp = -1;
|
||||
return one/vzero;
|
||||
}
|
||||
if(ix<0x3b900000) { /* |x|<2**-70, return -log(|x|) */
|
||||
if(hx<0) {
|
||||
*signgamp = -1;
|
||||
|
@ -132,7 +132,11 @@ __ieee754_lgammaf_r(float x, int *signgamp)
|
||||
*signgamp = 1;
|
||||
ix = hx&0x7fffffff;
|
||||
if(ix>=0x7f800000) return x*x;
|
||||
if(ix==0) return one/vzero;
|
||||
if(ix==0) {
|
||||
if(hx<0)
|
||||
*signgamp = -1;
|
||||
return one/vzero;
|
||||
}
|
||||
if(ix<0x35000000) { /* |x|<2**-21, return -log(|x|) */
|
||||
if(hx<0) {
|
||||
*signgamp = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user