Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/libm-tester/hash_cinz.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ asin u10 86c061caec3fa2e1bc71bda4dad29f4c
asin u35 31303b88bdc00206265002d6cc5e89e4
acos u10 0a1a403590f2ac8364f132b334920945
acos u35 493f960c1cce57931d95a5a22a0587a3
atan u10 e5c01c5ec2e9a535ac8d3000c346067d
atan u10 584ebe4bf2df7b60210f87f74b7d21d1
atan u10 c97624a24ec034cc0c8985acb61d13cd
atan u10 0be0f550406923016cfeb5ef62c25b15
atan u35 9d6d83e066b5a4851d44771418c9948c
atan u35 f32c1aa4caa08c6945afd1125ba8b113
atan2 u10 dfa671b1bae503fcae52246f65da3324
atan2 u10 6b1d9d25fcd96053acc19d1633fab36a
atan2 u35 afb07894347062a96dab705b34eb1763
sinh u10 61d459b1f368087f6f23ebf8e9f0ea01
cosh u10 f77eb95f79e274c12b4e92dc0389259b
Expand Down Expand Up @@ -73,13 +73,13 @@ sincospif u35 cec15ed76a358091632634166fa77b66
logf u10 c5a90119943acc4199e1cc7030b5def8
logf u35 af2fbe4bfa2caaf59c734e3749dd15be
log2f u10 ba8acae369bbb7b6404cccbc633fe25b
log2f u35 111da6eef2c9f1ca14793ff25807be7c
log2f u35 ba32ebaa8c470899ebd433d190c00f03
log10f u10 7e235a82d960e4434575dd39648d8bb7
log1pf u10 350fc4f13502b36bb1107e1b1122acb1
expf u10 ee4adaabefa3fac6c0f1925b2a948eea
exp2f u10 b0d283dbae0f36f1b3c7eed9871f0d0d
exp2f u35 522cc30f722f77fceb07015830b351a3
exp10f u10 ba6b659a6ac3945fcb602c73623b6ff2
exp10f u10 b0564be151965600f5744ff2e4992bc9
exp10f u35 d142f1fb40e44f0c9e042718f27ee3e0
expm1f u10 ebfd6498cb40f61b609882de8a7f3c74
powf u10 a7cba3239c87969662e8b41a4dd8b4ab
Expand Down
10 changes: 5 additions & 5 deletions src/libm-tester/hash_finz.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ asin u10 8a21b7c28cdaffc9d3e53f415367932e
asin u35 9c9e8107782898e9faed6924ad1b3cb1
acos u10 28261e4eb8331865660c814676d5c6bc
acos u35 310911130bfc45b10dabe3a072939331
atan u10 bfaf9c60689afb923c5c9637b3a711ca
atan u10 4e6b0112b6bb5a5fe936b9a01b8a7afc
atan u10 f931de72f2f6a7928f307a8a382ae255
atan u10 453f9ef62f58f9829320baf482a1d457
atan u35 6161b6189609f105b017d8768d0a41f1
atan u35 6face71d8d93c69448d49ed6140e361d
atan2 u10 7ca84089be978aca61b04c5be6aaf353
atan2 u10 469babaeee9bd30e17af2f473b3ea500
atan2 u35 6a3e764125aab2a0a13e7a0d9ec02f7f
sinh u10 61d459b1f368087f6f23ebf8e9f0ea01
cosh u10 f77eb95f79e274c12b4e92dc0389259b
Expand Down Expand Up @@ -73,13 +73,13 @@ sincospif u35 8720757f221c00cc8de24b7dc4949144
logf u10 c5a90119943acc4199e1cc7030b5def8
logf u35 b6234302d534d6ccd48155dd6b9a4293
log2f u10 ba8acae369bbb7b6404cccbc633fe25b
log2f u35 8596f906459db93ac21537fa73fe2a71
log2f u35 74174c90717c86642b71284452a8aef6
log10f u10 7e235a82d960e4434575dd39648d8bb7
log1pf u10 e53dbfa80bcc1a7bcfd21000e6950475
expf u10 9597388315e4b3e89c4c97ce46374dcf
exp2f u10 42d66e5e4cb88feb29c5b36c632159a5
exp2f u35 42d66e5e4cb88feb29c5b36c632159a5
exp10f u10 6fb0e9a829e12a06679d379d05b53ede
exp10f u10 954f0824b6d949d0da03b49950dc6642
exp10f u35 6fb0e9a829e12a06679d379d05b53ede
expm1f u10 ebfd6498cb40f61b609882de8a7f3c74
powf u10 2ed84af40d03e307a620365f172d010d
Expand Down
8 changes: 4 additions & 4 deletions src/libm/sleefdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ static Sleef_double2 atan2k_u1(Sleef_double2 y, Sleef_double2 x) {
t = ddnormalize_d2_d2(t);

double t2 = t.x * t.x, t4 = t2 * t2, t8 = t4 * t4, t16 = t8 * t8;
u = POLY17(t.x, t2, t4, t8, t16,
u = POLY16(t.x, t2, t4, t8,
1.06298484191448746607415e-05,
-0.000125620649967286867384336,
0.00070557664296393412389774,
Expand All @@ -640,8 +640,8 @@ static Sleef_double2 atan2k_u1(Sleef_double2 y, Sleef_double2 x) {
0.0587946590969581003860434,
-0.0666620884778795497194182,
0.0769225330296203768654095,
-0.0909090442773387574781907,
0.111111108376896236538123);
-0.0909090442773387574781907);
u = mla(u, t.x, 0.111111108376896236538123);
u = mla(u, t.x, -0.142857142756268568062339);
u = mla(u, t.x, 0.199999999997977351284817);
u = mla(u, t.x, -0.333333333333317605173818);
Expand Down Expand Up @@ -2621,7 +2621,7 @@ EXPORT CONST double xerfc_u15(double a) {
}

#ifdef ENABLE_MAIN
// gcc -w -DENABLE_MAIN -I../common sleefdp.c -lm
// gcc -w -DENABLE_MAIN -I../common sleefdp.c rempitab.c -lm
#include <stdlib.h>
int main(int argc, char **argv) {
double d1 = atof(argv[1]);
Expand Down
9 changes: 5 additions & 4 deletions src/libm/sleefsimddp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ static INLINE CONST VECTOR_CC vdouble2 atan2k_u1(vdouble2 y, vdouble2 x) {
t = ddnormalize_vd2_vd2(t);

vdouble t2 = vmul_vd_vd_vd(t.x, t.x), t4 = vmul_vd_vd_vd(t2, t2), t8 = vmul_vd_vd_vd(t4, t4), t16 = vmul_vd_vd_vd(t8, t8);
u = POLY17(t.x, t2, t4, t8, t16,
u = POLY16(t.x, t2, t4, t8,
1.06298484191448746607415e-05,
-0.000125620649967286867384336,
0.00070557664296393412389774,
Expand All @@ -1893,8 +1893,8 @@ static INLINE CONST VECTOR_CC vdouble2 atan2k_u1(vdouble2 y, vdouble2 x) {
0.0587946590969581003860434,
-0.0666620884778795497194182,
0.0769225330296203768654095,
-0.0909090442773387574781907,
0.111111108376896236538123);
-0.0909090442773387574781907);
u = vmla_vd_vd_vd_vd(u, t.x, vcast_vd_d(0.111111108376896236538123));
u = vmla_vd_vd_vd_vd(u, t.x, vcast_vd_d(-0.142857142756268568062339));
u = vmla_vd_vd_vd_vd(u, t.x, vcast_vd_d(0.199999999997977351284817));
u = vmla_vd_vd_vd_vd(u, t.x, vcast_vd_d(-0.333333333333317605173818));
Expand Down Expand Up @@ -3633,9 +3633,10 @@ EXPORT CONST void *xgetPtr(int name) {
#endif

#ifdef ENABLE_MAIN
// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimddp.c ../common/common.c -lm
// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimddp.c rempitab.c ../common/common.c -lm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char **argv) {
vdouble d1 = vcast_vd_d(atof(argv[1]));
vdouble d2 = vcast_vd_d(atof(argv[2]));
Expand Down
33 changes: 15 additions & 18 deletions src/libm/sleefsimdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2420,18 +2420,14 @@ EXPORT CONST VECTOR_CC vfloat xexp10f(vfloat d) {
s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Uf), d);
s = vmla_vf_vf_vf_vf(u, vcast_vf_f(-L10Lf), s);

u = vcast_vf_f(+0.2064004987e+0);
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5417877436e+0));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1171286821e+1));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2034656048e+1));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2650948763e+1));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2302585125e+1));

#ifdef ENABLE_FMA_SP
u = vfma_vf_vf_vf_vf(u, s, vcast_vf_f(1));
#else
u = dfnormalize_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf_vf(u, s))).x;
#endif
u = vcast_vf_f(+0.6802555919e-1);
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2078080326e+0));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.5393903852e+0));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.1171245337e+1));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2034678698e+1));
u = vmla_vf_vf_vf_vf(u, s, vcast_vf_f(+0.2650949001e+1));
vfloat2 x = dfadd_vf2_vf2_vf(vcast_vf2_f_f(2.3025851249694824219, -3.1705172516493593157e-08), vmul_vf_vf_vf(u, s));
u = dfnormalize_vf2_vf2(dfadd_vf2_vf_vf2(vcast_vf_f(1), dfmul_vf2_vf2_vf(x, s))).x;

u = vldexp2_vf_vf_vi2(u, q);

Expand Down Expand Up @@ -2584,20 +2580,20 @@ EXPORT CONST VECTOR_CC vfloat xlog2f_u35(vfloat d) {
x = vdiv_vf_vf_vf(vsub_vf_vf_vf(m, vcast_vf_f(1)), vadd_vf_vf_vf(m, vcast_vf_f(1)));
x2 = vmul_vf_vf_vf(x, x);

t = vcast_vf_f(+0.4374550283e+0f);
t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.5764790177e+0f));
t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.9618012905120f));
t = vcast_vf_f(+0.4374088347e+0);
t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.5764843822e+0));
t = vmla_vf_vf_vf_vf(t, x2, vcast_vf_f(+0.9618024230e+0));

#if !defined(ENABLE_AVX512F) && !defined(ENABLE_AVX512FNOFMA)
vfloat r = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(x2, x), t,
vmla_vf_vf_vf_vf(x, vcast_vf_f(2.8853900432586669922), vcast_vf_vi2(e)));
vmla_vf_vf_vf_vf(x, vcast_vf_f(+0.2885390043e+1), vcast_vf_vi2(e)));

r = vsel_vf_vo_vf_vf(vispinf_vo_vf(d), vcast_vf_f(SLEEF_INFINITY), r);
r = vsel_vf_vo_vf_vf(vor_vo_vo_vo(vlt_vo_vf_vf(d, vcast_vf_f(0)), visnan_vo_vf(d)), vcast_vf_f(SLEEF_NAN), r);
r = vsel_vf_vo_vf_vf(veq_vo_vf_vf(d, vcast_vf_f(0)), vcast_vf_f(-SLEEF_INFINITY), r);
#else
vfloat r = vmla_vf_vf_vf_vf(vmul_vf_vf_vf(x2, x), t,
vmla_vf_vf_vf_vf(x, vcast_vf_f(2.8853900432586669922), e));
vmla_vf_vf_vf_vf(x, vcast_vf_f(+0.2885390043e+1), e));

r = vfixup_vf_vf_vf_vi2_i(r, d, vcast_vi2_i((4 << (2*4)) | (3 << (4*4)) | (5 << (5*4)) | (2 << (6*4))), 0);
#endif
Expand Down Expand Up @@ -3320,9 +3316,10 @@ EXPORT CONST VECTOR_CC vfloat __tgammaf_u1_finite(vfloat) __attribute__(
#endif /* #ifdef ENABLE_GNUABI */

#ifdef ENABLE_MAIN
// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimdsp.c ../common/common.c -lm
// gcc -DENABLE_MAIN -Wno-attributes -I../common -I../arch -DENABLE_AVX2 -mavx2 -mfma sleefsimdsp.c rempitab.c ../common/common.c -lm
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char **argv) {
vfloat vf1 = vcast_vf_f(atof(argv[1]));
//vfloat vf2 = vcast_vf_f(atof(argv[2]));
Expand Down
17 changes: 9 additions & 8 deletions src/libm/sleefsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,13 +1590,14 @@ EXPORT CONST float xexp10f(float d) {
s = mlaf(q, -L10Uf, d);
s = mlaf(q, -L10Lf, s);

u = +0.2064004987e+0;
u = mlaf(u, s, +0.5417877436e+0);
u = mlaf(u, s, +0.1171286821e+1);
u = mlaf(u, s, +0.2034656048e+1);
u = mlaf(u, s, +0.2650948763e+1);
u = mlaf(u, s, +0.2302585125e+1);
u = dfnormalize_f2_f2(dfadd_f2_f_f2(1, dfmul_f2_f_f(u, s))).x;
u = +0.6802555919e-1;
u = mlaf(u, s, +0.2078080326e+0);
u = mlaf(u, s, +0.5393903852e+0);
u = mlaf(u, s, +0.1171245337e+1);
u = mlaf(u, s, +0.2034678698e+1);
u = mlaf(u, s, +0.2650949001e+1);
Sleef_float2 x = dfadd_f2_f2_f(df(2.3025851249694824219, -3.1705172516493593157e-08), u * s);
u = dfnormalize_f2_f2(dfadd_f2_f_f2(1, dfmul_f2_f2_f(x, s))).x;

u = ldexp2kf(u, q);

Expand Down Expand Up @@ -2354,7 +2355,7 @@ EXPORT CONST float xerfcf_u15(float a) {
//

#ifdef ENABLE_MAIN
// gcc -w -DENABLE_MAIN -I../common sleefsp.c -lm
// gcc -w -DENABLE_MAIN -I../common sleefsp.c rempitab.c -lm
#include <stdlib.h>
int main(int argc, char **argv) {
float d1 = atof(argv[1]);
Expand Down