FreeBSD Bugzilla – Attachment 201620 Details for
Bug 235413
[LIBM] optizimation for cexp and cexpf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
cexp.diff (text/plain), 1.75 KB, created by
Steve Kargl
on 2019-02-02 00:28:44 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Steve Kargl
Created:
2019-02-02 00:28:44 UTC
Size:
1.75 KB
patch
obsolete
>Index: msun/src/s_cexp.c >=================================================================== >--- msun/src/s_cexp.c (revision 2135) >+++ msun/src/s_cexp.c (working copy) >@@ -41,7 +41,7 @@ > double complex > cexp(double complex z) > { >- double x, y, exp_x; >+ double c, exp_x, s, x, y; > uint32_t hx, hy, lx, ly; > > x = creal(z); >@@ -55,8 +55,10 @@ > return (CMPLX(exp(x), y)); > EXTRACT_WORDS(hx, lx, x); > /* cexp(0 + I y) = cos(y) + I sin(y) */ >- if (((hx & 0x7fffffff) | lx) == 0) >- return (CMPLX(cos(y), sin(y))); >+ if (((hx & 0x7fffffff) | lx) == 0) { >+ sincos(y, &s, &c); >+ return (CMPLX(c, s)); >+ } > > if (hy >= 0x7ff00000) { > if (lx != 0 || (hx & 0x7fffffff) != 0x7ff00000) { >@@ -86,6 +88,7 @@ > * - x = NaN (spurious inexact exception from y) > */ > exp_x = exp(x); >- return (CMPLX(exp_x * cos(y), exp_x * sin(y))); >+ sincos(y, &s, &c); >+ return (CMPLX(exp_x * c, exp_x * s)); > } > } >Index: msun/src/s_cexpf.c >=================================================================== >--- msun/src/s_cexpf.c (revision 2135) >+++ msun/src/s_cexpf.c (working copy) >@@ -41,7 +41,7 @@ > float complex > cexpf(float complex z) > { >- float x, y, exp_x; >+ float c, exp_x, s, x, y; > uint32_t hx, hy; > > x = crealf(z); >@@ -55,8 +55,10 @@ > return (CMPLXF(expf(x), y)); > GET_FLOAT_WORD(hx, x); > /* cexp(0 + I y) = cos(y) + I sin(y) */ >- if ((hx & 0x7fffffff) == 0) >- return (CMPLXF(cosf(y), sinf(y))); >+ if ((hx & 0x7fffffff) == 0) { >+ sincosf(y, &s, &c); >+ return (CMPLXF(c, s)); >+ } > > if (hy >= 0x7f800000) { > if ((hx & 0x7fffffff) != 0x7f800000) { >@@ -86,6 +88,7 @@ > * - x = NaN (spurious inexact exception from y) > */ > exp_x = expf(x); >- return (CMPLXF(exp_x * cosf(y), exp_x * sinf(y))); >+ sincosf(y, &s, &c); >+ return (CMPLXF(exp_x * c, exp_x * s)); > } > }
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 235413
:
201620
|
202398
|
208609