Skip to content

Instantly share code, notes, and snippets.

@gnzlbg
Created July 10, 2019 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnzlbg/b282db61d37e305b7ca153d41f179f7c to your computer and use it in GitHub Desktop.
Save gnzlbg/b282db61d37e305b7ca153d41f179f7c to your computer and use it in GitHub Desktop.
libm no inline
name old ns/iter new ns/iter diff ns/iter diff % speedup
acos 3 2 -1 -33.33% x 1.50
acosf 2 3 1 50.00% x 0.67
acosh 114 132 18 15.79% x 0.86
acoshf 48 52 4 8.33% x 0.92
asin 2 4 2 100.00% x 0.50
asinf 2 3 1 50.00% x 0.67
atan 13 15 2 15.38% x 0.87
atan2 23 22 -1 -4.35% x 1.05
atan2f 11 15 4 36.36% x 0.73
atanf 8 9 1 12.50% x 0.89
cbrt 15 15 0 0.00% x 1.00
cbrtf 12 11 -1 -8.33% x 1.09
ceil 3 5 2 66.67% x 0.60
ceilf 2 3 1 50.00% x 0.67
copysign 2 2 0 0.00% x 1.00
copysignf 2 2 0 0.00% x 1.00
cos 15 15 0 0.00% x 1.00
cosf 8 16 8 100.00% x 0.50
cosh 23 21 -2 -8.70% x 1.10
coshf 16 15 -1 -6.25% x 1.07
erf 6 6 0 0.00% x 1.00
erff 5 5 0 0.00% x 1.00
exp 14 14 0 0.00% x 1.00
exp10 32 87 55 171.88% x 0.37
exp10f 12 13 1 8.33% x 0.92
exp2 7 8 1 14.29% x 0.88
exp2f 6 5 -1 -16.67% x 1.20
expf 10 10 0 0.00% x 1.00
expm1 22 22 0 0.00% x 1.00
expm1f 31 31 0 0.00% x 1.00
fabs 0 2 2 inf% x 0.00
fabsf 0 2 2 inf% x 0.00
fdim 0 3 3 inf% x 0.00
fdimf 0 3 3 inf% x 0.00
floor 3 5 2 66.67% x 0.60
floorf 2 3 1 50.00% x 0.67
fma 14 15 1 7.14% x 0.93
fmaf 3 4 1 33.33% x 0.75
fmax 0 2 2 inf% x 0.00
fmaxf 0 2 2 inf% x 0.00
fmin 0 2 2 inf% x 0.00
fminf 0 2 2 inf% x 0.00
fmod 2 3 1 50.00% x 0.67
fmodf 2 3 1 50.00% x 0.67
hypot 98 97 -1 -1.02% x 1.01
hypotf 34 36 2 5.88% x 0.94
j0 177 182 5 2.82% x 0.97
j0f 99 98 -1 -1.01% x 1.01
j1 182 182 0 0.00% x 1.00
j1f 99 105 6 6.06% x 0.94
jn 566 565 -1 -0.18% x 1.00
jnf 311 315 4 1.29% x 0.99
ldexp 1 4 3 300.00% x 0.25
ldexpf 1 3 2 200.00% x 0.33
lgamma 23 23 0 0.00% x 1.00
lgammaf 16 16 0 0.00% x 1.00
log 14 13 -1 -7.14% x 1.08
log10 17 20 3 17.65% x 0.85
log10f 12 13 1 8.33% x 0.92
log1p 14 14 0 0.00% x 1.00
log1pf 10 9 -1 -10.00% x 1.11
log2 18 16 -2 -11.11% x 1.12
log2f 11 11 0 0.00% x 1.00
logf 9 9 0 0.00% x 1.00
pow 83 82 -1 -1.20% x 1.01
powf 37 36 -1 -2.70% x 1.03
round 3 6 3 100.00% x 0.50
roundf 3 6 3 100.00% x 0.50
scalbn 1 4 3 300.00% x 0.25
scalbnf 1 3 2 200.00% x 0.33
sin 16 16 0 0.00% x 1.00
sinf 8 15 7 87.50% x 0.53
sinh 33 35 2 6.06% x 0.94
sinhf 25 26 1 4.00% x 0.96
sqrt 0 95 95 inf% x 0.00
sqrtf 0 26 26 inf% x 0.00
tan 30 31 1 3.33% x 0.97
tanf 11 17 6 54.55% x 0.65
tanh 3 3 0 0.00% x 1.00
tanhf 2 3 1 50.00% x 0.67
tgamma 183 203 20 10.93% x 0.90
tgammaf 186 205 19 10.22% x 0.91
trunc 0 3 3 inf% x 0.00
truncf 0 3 3 inf% x 0.00
y0 180 183 3 1.67% x 0.98
y0f 99 99 0 0.00% x 1.00
y1 182 184 2 1.10% x 0.99
y1f 100 110 10 10.00% x 0.91
yn 575 577 2 0.35% x 1.00
ynf 329 330 1 0.30% x 1.00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment