FreeBSD Bugzilla – Attachment 194744 Details for
Bug 229420
Reduce diff between msun/src/e_pow.c and msun/src/e_powf.c
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
reduce diff
z_pow.diff (text/plain), 2.98 KB, created by
sgk
on 2018-06-29 20:48:05 UTC
(
hide
)
Description:
reduce diff
Filename:
MIME Type:
Creator:
sgk
Created:
2018-06-29 20:48:05 UTC
Size:
2.98 KB
patch
obsolete
>diff -uN /usr/src/lib/msun/src/e_pow.c ./src/e_pow.c >--- /usr/src/lib/msun/src/e_pow.c 2017-12-15 10:02:32.739897000 -0800 >+++ ./src/e_pow.c 2018-05-14 17:17:36.321216000 -0700 >@@ -65,6 +65,9 @@ > dp_h[] = { 0.0, 5.84962487220764160156e-01,}, /* 0x3FE2B803, 0x40000000 */ > dp_l[] = { 0.0, 1.35003920212974897128e-08,}, /* 0x3E4CFDEB, 0x43CFD006 */ > zero = 0.0, >+half = 0.5, >+qrtr = 0.25, >+thrd = 3.3333333333333331e-01, /* 0x3fd55555, 0x55555555 */ > one = 1.0, > two = 2.0, > two53 = 9007199254740992.0, /* 0x43400000, 0x00000000 */ >@@ -197,7 +200,7 @@ > /* now |1-x| is tiny <= 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ > t = ax-one; /* t has 20 trailing zeros */ >- w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25)); >+ w = (t*t)*(half-t*(thrd-t*qrtr)); > u = ivln2_h*t; /* ivln2_h has 21 sig. bits */ > v = t*ivln2_l-w*ivln2; > t1 = u+v; >@@ -234,9 +237,9 @@ > r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); > r += s_l*(s_h+ss); > s2 = s_h*s_h; >- t_h = 3.0+s2+r; >+ t_h = 3+s2+r; > SET_LOW_WORD(t_h,0); >- t_l = r-((t_h-3.0)-s2); >+ t_l = r-((t_h-3)-s2); > /* u+v = ss*(1+...) */ > u = s_h*t_h; > v = s_l*t_h+t_l*ss; >@@ -247,7 +250,7 @@ > z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */ > z_l = cp_l*p_h+p_l*cp+dp_l[k]; > /* log2(ax) = (ss+..)*2/(3*log2) = n + dp_h + z_h + z_l */ >- t = (double)n; >+ t = n; > t1 = (((z_h+z_l)+dp_h[k])+t); > SET_LOW_WORD(t1,0); > t2 = z_l-(((t1-t)-dp_h[k])-z_h); >diff -uN /usr/src/lib/msun/src/e_powf.c ./src/e_powf.c >--- /usr/src/lib/msun/src/e_powf.c 2011-10-28 14:07:13.000000000 -0700 >+++ ./src/e_powf.c 2018-04-17 17:33:43.051533000 -0700 >@@ -24,6 +24,9 @@ > dp_h[] = { 0.0, 5.84960938e-01,}, /* 0x3f15c000 */ > dp_l[] = { 0.0, 1.56322085e-06,}, /* 0x35d1cfdc */ > zero = 0.0, >+half = 0.5, >+qrtr = 0.25, >+thrd = 3.33333343e-01, /* 0x3eaaaaab */ > one = 1.0, > two = 2.0, > two24 = 16777216.0, /* 0x4b800000 */ >@@ -138,7 +141,7 @@ > /* now |1-x| is tiny <= 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ > t = ax-1; /* t has 20 trailing zeros */ >- w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25)); >+ w = (t*t)*(half-t*(thrd-t*qrtr)); > u = ivln2_h*t; /* ivln2_h has 16 sig. bits */ > v = t*ivln2_l-w*ivln2; > t1 = u+v; >@@ -177,10 +180,10 @@ > r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); > r += s_l*(s_h+s); > s2 = s_h*s_h; >- t_h = (float)3.0+s2+r; >+ t_h = 3+s2+r; > GET_FLOAT_WORD(is,t_h); > SET_FLOAT_WORD(t_h,is&0xfffff000); >- t_l = r-((t_h-(float)3.0)-s2); >+ t_l = r-((t_h-3)-s2); > /* u+v = s*(1+...) */ > u = s_h*t_h; > v = s_l*t_h+t_l*s; >@@ -192,7 +195,7 @@ > z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */ > z_l = cp_l*p_h+p_l*cp+dp_l[k]; > /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */ >- t = (float)n; >+ t = n; > t1 = (((z_h+z_l)+dp_h[k])+t); > GET_FLOAT_WORD(is,t1); > SET_FLOAT_WORD(t1,is&0xfffff000);
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 229420
: 194744