
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 76.4% |
|---|---|
| Target | 99.8% |
| Herbie | 100.0% |
if x < -2e10Initial program 50.7%
Taylor expanded in x around inf 100.0%
if -2e10 < x < 1e4Initial program 100.0%
clear-num99.8%
associate-/r/100.0%
fma-def100.0%
Applied egg-rr100.0%
if 1e4 < x Initial program 45.8%
clear-num45.9%
associate-/r/45.8%
fma-def45.8%
Applied egg-rr45.8%
Taylor expanded in x around inf 100.0%
exp-to-pow100.0%
*-commutative100.0%
exp-neg100.0%
distribute-lft-neg-in100.0%
metadata-eval100.0%
*-commutative100.0%
exp-to-pow100.0%
Simplified100.0%
Final simplification100.0%
if x < -1e30Initial program 49.9%
Taylor expanded in x around inf 100.0%
if -1e30 < x < 1e4Initial program 100.0%
if 1e4 < x Initial program 45.8%
clear-num45.9%
associate-/r/45.8%
fma-def45.8%
Applied egg-rr45.8%
Taylor expanded in x around inf 100.0%
exp-to-pow100.0%
*-commutative100.0%
exp-neg100.0%
distribute-lft-neg-in100.0%
metadata-eval100.0%
*-commutative100.0%
exp-to-pow100.0%
Simplified100.0%
Final simplification100.0%
if x < -0.859999999999999987 or 0.859999999999999987 < x Initial program 48.8%
Taylor expanded in x around inf 99.2%
if -0.859999999999999987 < x < 0.859999999999999987Initial program 100.0%
clear-num99.8%
associate-/r/100.0%
fma-def100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 98.4%
unpow298.4%
neg-mul-198.4%
sub-neg98.4%
Simplified98.4%
Final simplification98.8%
if x < -1e30 or 1e8 < x Initial program 47.3%
Taylor expanded in x around inf 100.0%
if -1e30 < x < 1e8Initial program 100.0%
Final simplification100.0%
if x < -1 or 1 < x Initial program 48.8%
Taylor expanded in x around inf 99.2%
if -1 < x < 1Initial program 100.0%
Taylor expanded in x around 0 97.7%
Final simplification98.5%
Initial program 73.2%
Taylor expanded in x around 0 48.4%
Final simplification48.4%
herbie shell --seed 2023166
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))