
Results
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) < -inf.0 or 5.00000000000000024e-5 < (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 x) (exp.f64 (neg.f64 x))) < 5.00000000000000024e-5Initial program 8.9%
Taylor expanded in x around 0 100.0%
expm1-log1p-u100.0%
expm1-udef99.4%
log1p-udef99.4%
rem-exp-log99.4%
Applied egg-rr99.4%
add-exp-log99.4%
log1p-udef99.4%
expm1-udef100.0%
expm1-log1p-u100.0%
unpow3100.0%
associate-*r*100.0%
Applied egg-rr100.0%
Final simplification100.0%
if x < -1.00000000000000001e160Initial program 100.0%
Taylor expanded in x around 0 100.0%
unpow3100.0%
associate-*r*100.0%
distribute-rgt-out100.0%
*-commutative100.0%
+-commutative100.0%
associate-*l*100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
associate-*r*100.0%
*-commutative100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 100.0%
unpow2100.0%
*-commutative100.0%
associate-*r*100.0%
Simplified100.0%
if -1.00000000000000001e160 < x < 5.60000000000000037e102Initial program 41.6%
Taylor expanded in x around 0 73.5%
unpow373.5%
associate-*r*73.5%
distribute-rgt-out73.5%
*-commutative73.5%
+-commutative73.5%
associate-*l*73.5%
fma-def73.5%
Simplified73.5%
fma-udef73.5%
associate-*r*73.5%
*-commutative73.5%
Applied egg-rr73.5%
+-commutative73.5%
flip-+78.0%
metadata-eval78.0%
*-commutative78.0%
*-commutative78.0%
swap-sqr78.0%
pow278.0%
pow278.0%
pow-prod-up78.0%
metadata-eval78.0%
metadata-eval78.0%
*-commutative78.0%
associate-*r*78.0%
Applied egg-rr78.0%
if 5.60000000000000037e102 < x Initial program 100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in x around inf 100.0%
Final simplification84.4%
Initial program 58.7%
Taylor expanded in x around 0 81.3%
Final simplification81.3%
if x < -2.5 or 2.5 < x Initial program 100.0%
Taylor expanded in x around 0 65.8%
unpow365.8%
associate-*r*65.2%
distribute-rgt-out65.2%
*-commutative65.2%
+-commutative65.2%
associate-*l*65.2%
fma-def65.2%
Simplified65.2%
fma-udef65.2%
associate-*r*65.2%
*-commutative65.2%
Applied egg-rr65.2%
Taylor expanded in x around inf 65.2%
unpow265.2%
*-commutative65.2%
associate-*r*65.2%
Simplified65.2%
if -2.5 < x < 2.5Initial program 9.7%
Taylor expanded in x around 0 98.6%
Final simplification80.5%
Initial program 58.7%
Taylor expanded in x around 0 81.3%
expm1-log1p-u63.6%
expm1-udef63.4%
log1p-udef63.4%
rem-exp-log81.0%
Applied egg-rr81.0%
add-exp-log63.4%
log1p-udef63.4%
expm1-udef63.6%
expm1-log1p-u81.3%
unpow381.3%
associate-*r*80.9%
Applied egg-rr80.9%
Final simplification80.9%
Initial program 58.7%
Taylor expanded in x around 0 81.3%
unpow381.3%
associate-*r*80.9%
distribute-rgt-out80.9%
*-commutative80.9%
+-commutative80.9%
associate-*l*80.9%
fma-def80.9%
Simplified80.9%
fma-udef80.9%
associate-*r*80.9%
*-commutative80.9%
Applied egg-rr80.9%
Final simplification80.9%
Initial program 58.7%
Taylor expanded in x around 0 47.9%
Final simplification47.9%
Initial program 58.7%
Applied egg-rr2.9%
Final simplification2.9%
Initial program 58.7%
Applied egg-rr3.3%
Final simplification3.3%
herbie shell --seed 2023166
(FPCore (x)
:name "Hyperbolic sine"
:precision binary64
(/ (- (exp x) (exp (- x))) 2.0))