
Results
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 89.2% |
|---|---|
| Target | 99.5% |
| Herbie | 99.5% |
if z < -5.4999999999999996e65 or 72 < z Initial program 77.3%
+-commutative77.3%
sub-neg77.3%
+-commutative77.3%
associate-+r+77.3%
unsub-neg77.3%
associate-+l-77.3%
distribute-lft-out--77.3%
*-rgt-identity77.3%
distribute-rgt-out--76.1%
sub-neg76.1%
+-commutative76.1%
associate--r+76.1%
div-sub76.0%
Simplified92.7%
Taylor expanded in y around inf 92.7%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in y around 0 92.7%
neg-mul-192.7%
sub-neg92.7%
associate-*l/100.0%
*-commutative100.0%
Simplified100.0%
if -5.4999999999999996e65 < z < 72Initial program 99.3%
associate-/l*92.7%
Simplified92.7%
associate-/r/99.9%
Applied egg-rr99.9%
Final simplification100.0%
if (/.f64 (*.f64 x (+.f64 (-.f64 y z) 1)) z) < -inf.0Initial program 67.0%
associate-/l*100.0%
Simplified100.0%
if -inf.0 < (/.f64 (*.f64 x (+.f64 (-.f64 y z) 1)) z) Initial program 94.1%
+-commutative94.1%
sub-neg94.1%
+-commutative94.1%
associate-+r+94.1%
unsub-neg94.1%
associate-+l-94.1%
distribute-lft-out--94.1%
*-rgt-identity94.1%
distribute-rgt-out--94.0%
sub-neg94.0%
+-commutative94.0%
associate--r+94.0%
div-sub94.0%
Simplified98.6%
Final simplification98.9%
if (/.f64 (*.f64 x (+.f64 (-.f64 y z) 1)) z) < 4.9999999999999997e161Initial program 92.4%
associate-/l*98.0%
Simplified98.0%
if 4.9999999999999997e161 < (/.f64 (*.f64 x (+.f64 (-.f64 y z) 1)) z) Initial program 78.9%
associate-/l*88.9%
Simplified88.9%
associate-/r/99.8%
Applied egg-rr99.8%
Final simplification98.4%
if z < -0.94999999999999996 or 1.15e19 < z Initial program 76.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 82.9%
neg-mul-182.9%
Simplified82.9%
if -0.94999999999999996 < z < -2.50000000000000013e-102 or -1.64999999999999998e-167 < z < 1.90000000000000006e-176 or 1.7499999999999999e-44 < z < 1.15e19Initial program 99.9%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in y around inf 57.9%
associate-/r/71.3%
Applied egg-rr71.3%
if -2.50000000000000013e-102 < z < -1.64999999999999998e-167 or 1.90000000000000006e-176 < z < 1.7499999999999999e-44Initial program 100.0%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in z around 0 97.8%
Taylor expanded in y around 0 79.4%
Final simplification77.9%
if y < -1 or 1 < y Initial program 90.4%
+-commutative90.4%
sub-neg90.4%
+-commutative90.4%
associate-+r+90.4%
unsub-neg90.4%
associate-+l-90.4%
distribute-lft-out--90.4%
*-rgt-identity90.4%
distribute-rgt-out--89.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
div-sub89.2%
Simplified92.0%
Taylor expanded in y around inf 91.9%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in y around 0 91.9%
neg-mul-191.9%
sub-neg91.9%
associate-*l/91.3%
*-commutative91.3%
Simplified91.3%
if -1 < y < 1Initial program 88.4%
+-commutative88.4%
sub-neg88.4%
+-commutative88.4%
associate-+r+88.4%
unsub-neg88.4%
associate-+l-88.4%
distribute-lft-out--88.4%
*-rgt-identity88.4%
distribute-rgt-out--88.4%
sub-neg88.4%
+-commutative88.4%
associate--r+88.4%
div-sub88.3%
Simplified100.0%
Taylor expanded in y around 0 99.0%
Final simplification95.4%
if y < -1 or 1 < y Initial program 90.4%
+-commutative90.4%
sub-neg90.4%
+-commutative90.4%
associate-+r+90.4%
unsub-neg90.4%
associate-+l-90.4%
distribute-lft-out--90.4%
*-rgt-identity90.4%
distribute-rgt-out--89.2%
sub-neg89.2%
+-commutative89.2%
associate--r+89.2%
div-sub89.2%
Simplified92.0%
Taylor expanded in y around inf 91.9%
associate-/l*95.7%
Simplified95.7%
if -1 < y < 1Initial program 88.4%
+-commutative88.4%
sub-neg88.4%
+-commutative88.4%
associate-+r+88.4%
unsub-neg88.4%
associate-+l-88.4%
distribute-lft-out--88.4%
*-rgt-identity88.4%
distribute-rgt-out--88.4%
sub-neg88.4%
+-commutative88.4%
associate--r+88.4%
div-sub88.3%
Simplified100.0%
Taylor expanded in y around 0 99.0%
Final simplification97.5%
if y < -1Initial program 92.6%
+-commutative92.6%
sub-neg92.6%
+-commutative92.6%
associate-+r+92.6%
unsub-neg92.6%
associate-+l-92.6%
distribute-lft-out--92.6%
*-rgt-identity92.6%
distribute-rgt-out--90.7%
sub-neg90.7%
+-commutative90.7%
associate--r+90.7%
div-sub90.6%
Simplified95.5%
Taylor expanded in y around inf 95.3%
if -1 < y < 1Initial program 88.4%
+-commutative88.4%
sub-neg88.4%
+-commutative88.4%
associate-+r+88.4%
unsub-neg88.4%
associate-+l-88.4%
distribute-lft-out--88.4%
*-rgt-identity88.4%
distribute-rgt-out--88.4%
sub-neg88.4%
+-commutative88.4%
associate--r+88.4%
div-sub88.3%
Simplified100.0%
Taylor expanded in y around 0 99.0%
if 1 < y Initial program 87.9%
+-commutative87.9%
sub-neg87.9%
+-commutative87.9%
associate-+r+87.9%
unsub-neg87.9%
associate-+l-87.9%
distribute-lft-out--87.9%
*-rgt-identity87.9%
distribute-rgt-out--87.5%
sub-neg87.5%
+-commutative87.5%
associate--r+87.5%
div-sub87.5%
Simplified88.0%
Taylor expanded in y around inf 88.0%
associate-/l*96.4%
Simplified96.4%
Final simplification97.5%
if y < -1.8e9 or 5e19 < y Initial program 90.1%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in y around inf 69.3%
associate-/r/74.5%
Applied egg-rr74.5%
if -1.8e9 < y < 5e19Initial program 88.7%
+-commutative88.7%
sub-neg88.7%
+-commutative88.7%
associate-+r+88.7%
unsub-neg88.7%
associate-+l-88.7%
distribute-lft-out--88.7%
*-rgt-identity88.7%
distribute-rgt-out--88.7%
sub-neg88.7%
+-commutative88.7%
associate--r+88.7%
div-sub88.7%
Simplified100.0%
Taylor expanded in y around 0 99.0%
Final simplification88.0%
if y < -1.35e10Initial program 92.6%
Taylor expanded in y around inf 77.0%
if -1.35e10 < y < 2.6e20Initial program 88.7%
+-commutative88.7%
sub-neg88.7%
+-commutative88.7%
associate-+r+88.7%
unsub-neg88.7%
associate-+l-88.7%
distribute-lft-out--88.7%
*-rgt-identity88.7%
distribute-rgt-out--88.7%
sub-neg88.7%
+-commutative88.7%
associate--r+88.7%
div-sub88.7%
Simplified100.0%
Taylor expanded in y around 0 99.0%
if 2.6e20 < y Initial program 87.0%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in y around inf 68.3%
associate-/r/73.6%
Applied egg-rr73.6%
Final simplification88.5%
if z < -1 or 1 < z Initial program 77.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 80.3%
neg-mul-180.3%
Simplified80.3%
if -1 < z < 1Initial program 99.9%
associate-/l*92.4%
Simplified92.4%
Taylor expanded in z around 0 91.8%
Taylor expanded in y around 0 55.1%
Final simplification67.0%
Initial program 89.3%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 39.6%
neg-mul-139.6%
Simplified39.6%
Final simplification39.6%
herbie shell --seed 2023166
(FPCore (x y z)
:name "Diagrams.TwoD.Segment.Bernstein:evaluateBernstein from diagrams-lib-1.3.0.3"
:precision binary64
:herbie-target
(if (< x -2.71483106713436e-162) (- (* (+ 1.0 y) (/ x z)) x) (if (< x 3.874108816439546e-197) (* (* x (+ (- y z) 1.0)) (/ 1.0 z)) (- (* (+ 1.0 y) (/ x z)) x)))
(/ (* x (+ (- y z) 1.0)) z))