FreeBSD Bugzilla – Attachment 126476 Details for
Bug 170206
[msun] [patch] complex arcsinh, log, etc.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
ca.diff
ca.diff (text/x-diff), 2.23 KB, created by
Stephen Montgomery-Smith
on 2012-07-28 22:46:39 UTC
(
hide
)
Description:
ca.diff
Filename:
MIME Type:
Creator:
Stephen Montgomery-Smith
Created:
2012-07-28 22:46:39 UTC
Size:
2.23 KB
patch
obsolete
>--- catrig.c-old1 2012-07-28 15:00:46.000000000 -0500 >+++ catrig.c 2012-07-28 16:39:24.000000000 -0500 >@@ -89,7 +89,7 @@ > S = hypot(x,y-1); > A = 0.5*(R + S); > >- if (A < 10) { >+ if (A < 10 && isfinite(A)) { > fp = f(x,1+y,&fpuf); > fm = f(x,1-y,&fmuf); > if (fpuf == 1 && fmuf == 1) { >@@ -108,9 +108,23 @@ > } else { > *rx = log1p(fp + fm + sqrt((fp+fm)*(A+1))); > } >- } else >+ } else if (isinf(y)) >+ *rx = y; >+ else > *rx = log(A + sqrt(A*A-1)); > >+ if (!isfinite(y)) { >+ *B_good = 0; >+ if (isfinite(x)) *A2my2 = 0; >+ else if (isnan(x)) *A2my2 = x; >+ else *A2my2 = y; >+ return; >+ } else if (isnan(x) && y == 0) { >+ *B_good = 0; >+ *A2my2 = 1; >+ return; >+ } >+ > *B = y/A; /* = 0.5*(R - S) */ > *B_good = 1; > >@@ -147,7 +161,7 @@ > x = fabs(x); > y = fabs(y); > >- if (cabs(z) > 1e20) { >+ if (cabs(z) > 1e20 && isfinite(x) && isfinite(y)) { > if (huge+x>one) { /* set inexact flag. */ > if (sx == 0) return clog(2*z); > if (sx == 1) return -clog(-2*z); >@@ -206,7 +220,7 @@ > x = fabs(x); > y = fabs(y); > >- if (cabs(z) > 1e20) { >+ if (cabs(z) > 1e20 && isfinite(x) && isfinite(y)) { > if (huge+x>one) { /* set inexact flag. */ > w = clog(2*z); > if (signbit(cimag(w)) == 0) >@@ -271,6 +285,36 @@ > if (huge+x>one) /* set inexact flag. */ > return z; > >+ if (isinf(x) && isfinite(y)) { >+ if (!((signbit(x) == 0) ^ (signbit(y) == 0))) >+ return cpack(0,M_PI_2); >+ return cpack(0,-M_PI_2); >+ } >+ >+ if (isinf(y)) { >+ rx = copysign(0,x); >+ if (signbit(y) == 0) >+ return cpack(rx,M_PI_2); >+ return cpack(rx,-M_PI_2); >+ } >+ >+ if (isinf(x) && isnan(y)) { >+ rx = copysign(0, x); >+ return cpack(rx, y); >+ } >+ >+ if (x == 0 && isnan(y)) >+ return cpack(x, y); >+ >+ if (isinf(y)) { >+ if (signbit(y) == 0) >+ return cpack(0,M_PI_2); >+ return cpack(0,-M_PI_2); >+ } >+ >+ if (isnan(x) || isnan(y)) >+ return clog(z); >+ > if (cabs(z) > 1e20) > if (huge+x>one) { /* set inexact flag. */ > if (signbit(x) == 0) >@@ -290,13 +334,17 @@ > > if (hp < 0.5 || hm < 0.5) > rx = 0.25*(log(hp/hm)); >+ else if (x == 0) >+ rx = x; > else if (x > 0) > rx = 0.25*log1p(4*x/hm); > else > rx = -0.25*log1p(-4*x/hp); > > if (x==1 || x==-1) { >- if (signbit(y) == 0) >+ if (y==0) >+ ry = y; >+ else if (signbit(y) == 0) > ry = atan2(2, -y)/2; > else > ry = atan2(-2, y)/2;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 170206
:
126473
|
126474
|
126475
| 126476 |
126477
|
126478