
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 99.8% |
|---|---|
| Target | 99.8% |
| Herbie | 99.9% |
Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
+-commutative99.9%
associate--r+99.9%
metadata-eval99.9%
associate-+r-99.9%
+-commutative99.9%
associate-+r-99.9%
Simplified99.9%
Final simplification99.9%
if x < -1.35e15Initial program 100.0%
Taylor expanded in x around inf 89.3%
if -1.35e15 < x < 3.79999999999999997e-222 or 1.85e-70 < x < 8.5e43Initial program 99.8%
Taylor expanded in y around inf 81.1%
*-commutative81.1%
log-rec81.1%
cancel-sign-sub81.1%
*-commutative81.1%
mul-1-neg81.1%
log-rec81.1%
log-rec81.1%
sub-neg81.1%
Simplified81.1%
if 3.79999999999999997e-222 < x < 1.85e-70Initial program 99.9%
Taylor expanded in y around 0 79.1%
Taylor expanded in x around 0 79.1%
*-commutative79.1%
Simplified79.1%
if 8.5e43 < x Initial program 99.9%
Taylor expanded in y around inf 99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
log-rec99.9%
remove-double-neg99.9%
Simplified99.9%
associate--l+99.9%
add-cube-cbrt97.9%
fma-def97.9%
pow297.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 92.3%
pow-base-192.3%
*-lft-identity92.3%
Simplified92.3%
Final simplification85.5%
if y < 3e15Initial program 100.0%
Taylor expanded in y around 0 98.0%
if 3e15 < y < 1.40000000000000001e74 or 5.80000000000000019e138 < y Initial program 99.7%
Taylor expanded in y around inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
log-rec99.7%
remove-double-neg99.7%
Simplified99.7%
associate--l+99.7%
add-cube-cbrt98.3%
fma-def98.2%
pow298.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 88.2%
pow-base-188.2%
*-lft-identity88.2%
Simplified88.2%
if 1.40000000000000001e74 < y < 5.80000000000000019e138Initial program 99.8%
Taylor expanded in y around inf 80.4%
*-commutative80.4%
log-rec80.4%
cancel-sign-sub80.4%
*-commutative80.4%
mul-1-neg80.4%
log-rec80.4%
log-rec80.4%
sub-neg80.4%
Simplified80.4%
Final simplification93.5%
if z < -7.4999999999999995e75 or 4.15000000000000011e36 < z Initial program 99.9%
Taylor expanded in x around inf 85.0%
if -7.4999999999999995e75 < z < 4.15000000000000011e36Initial program 99.9%
Taylor expanded in y around inf 78.8%
mul-1-neg78.8%
distribute-rgt-neg-in78.8%
log-rec78.8%
remove-double-neg78.8%
Simplified78.8%
associate--l+78.8%
add-cube-cbrt77.5%
fma-def77.5%
pow277.5%
Applied egg-rr77.5%
Taylor expanded in z around 0 77.5%
pow-base-177.5%
*-lft-identity77.5%
Simplified77.5%
Final simplification80.5%
if y < 0.28000000000000003Initial program 100.0%
Taylor expanded in y around 0 99.1%
if 0.28000000000000003 < y Initial program 99.8%
Taylor expanded in y around inf 99.4%
mul-1-neg99.4%
distribute-rgt-neg-in99.4%
log-rec99.4%
remove-double-neg99.4%
Simplified99.4%
Final simplification99.2%
Initial program 99.9%
Final simplification99.9%
Initial program 99.9%
+-commutative99.9%
associate-+r-99.9%
Applied egg-rr99.9%
Final simplification99.9%
if x < -44 or 1.3e15 < x Initial program 99.9%
Taylor expanded in x around inf 84.7%
if -44 < x < 1.3e15Initial program 99.8%
Taylor expanded in y around 0 66.3%
Taylor expanded in x around 0 65.4%
*-commutative65.4%
Simplified65.4%
Final simplification75.3%
Initial program 99.9%
Taylor expanded in x around inf 63.2%
Final simplification63.2%
Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
associate-+l+99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
+-commutative99.9%
associate--r+99.9%
metadata-eval99.9%
associate-+r-99.9%
+-commutative99.9%
associate-+r-99.9%
Simplified99.9%
Taylor expanded in z around inf 29.9%
mul-1-neg29.9%
Simplified29.9%
Final simplification29.9%
Initial program 99.9%
Taylor expanded in y around inf 87.2%
mul-1-neg87.2%
distribute-rgt-neg-in87.2%
log-rec87.2%
remove-double-neg87.2%
Simplified87.2%
associate--l+87.2%
add-cube-cbrt86.1%
fma-def86.1%
pow286.1%
Applied egg-rr86.1%
Taylor expanded in y around inf 2.6%
Final simplification2.6%
herbie shell --seed 2023166
(FPCore (x y z)
:name "Numeric.SpecFunctions:stirlingError from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(- (- (+ y x) z) (* (+ y 0.5) (log y)))
(- (+ (- x (* (+ y 0.5) (log y))) y) z))