Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 04e80a02 authored by Alexei Sibidanov's avatar Alexei Sibidanov
Browse files

log1pf and atanf: fix problems with signed zero arguments found by Paul

parent 4f6a157d
No related tags found
No related merge requests found
Pipeline #994642 passed
...@@ -46,8 +46,10 @@ float cr_atanf(float x){ ...@@ -46,8 +46,10 @@ float cr_atanf(float x){
return __builtin_copysign(pi2,(double)x); // inf return __builtin_copysign(pi2,(double)x); // inf
} }
if (__builtin_expect(e<127-13, 0)){ if (__builtin_expect(e<127-13, 0)){
if (__builtin_expect(e<127-25, 0)) if (__builtin_expect(e<127-25, 0)){
if(!(t.u<<1)) return x;
return __builtin_fmaf(-x, __builtin_fabsf(x), x); return __builtin_fmaf(-x, __builtin_fabsf(x), x);
}
return __builtin_fmaf(-0x1.5555555555555p-2f*x, x*x, x); return __builtin_fmaf(-0x1.5555555555555p-2f*x, x*x, x);
} }
/* now |x| >= 0x1p-13 */ /* now |x| >= 0x1p-13 */
......
...@@ -84,7 +84,10 @@ float cr_log1pf(float x) { ...@@ -84,7 +84,10 @@ float cr_log1pf(float x) {
b32u32_u t = {.f = x}; b32u32_u t = {.f = x};
uint32_t ux = t.u, ax = ux&(~0u>>1); uint32_t ux = t.u, ax = ux&(~0u>>1);
if(__builtin_expect(ax<0x3c880000, 1)){ if(__builtin_expect(ax<0x3c880000, 1)){
if(__builtin_expect(ax<0x33000000, 0)) return __builtin_fmaf(x,-x,x); if(__builtin_expect(ax<0x33000000, 0)){
if(!ax) return x;
return __builtin_fmaf(x,-x,x);
}
double z2 = z*z, z4 = z2*z2; double z2 = z*z, z4 = z2*z2;
double f = z2*((b[1] + z*b[2]) + z2*(b[3] + z*b[4]) + z4*((b[5] + z*b[6]) + z2*b[7])); double f = z2*((b[1] + z*b[2]) + z2*(b[3] + z*b[4]) + z4*((b[5] + z*b[6]) + z2*b[7]));
b64u64_u r = {.f = z + f}; b64u64_u r = {.f = z + f};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment