
Results
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
| Original | 68.8% |
|---|---|
| Target | 98.9% |
| Herbie | 99.7% |
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 5.0000000000000001e-9Initial program 39.2%
frac-sub39.3%
div-inv39.3%
*-un-lft-identity39.3%
+-commutative39.3%
*-rgt-identity39.3%
metadata-eval39.3%
frac-times39.3%
un-div-inv39.3%
pow1/239.3%
pow-flip39.3%
metadata-eval39.3%
+-commutative39.3%
Applied egg-rr39.3%
associate-*r/39.3%
*-rgt-identity39.3%
times-frac39.3%
div-sub39.3%
*-inverses39.3%
/-rgt-identity39.3%
Simplified39.3%
Taylor expanded in x around inf 99.6%
associate--l+99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
associate-*r/99.6%
metadata-eval99.6%
unpow299.6%
Simplified99.6%
if 5.0000000000000001e-9 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.3%
frac-sub99.3%
div-inv99.3%
*-un-lft-identity99.3%
+-commutative99.3%
*-rgt-identity99.3%
metadata-eval99.3%
frac-times99.3%
un-div-inv99.3%
pow1/299.3%
pow-flip99.8%
metadata-eval99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
times-frac99.8%
div-sub99.8%
*-inverses99.8%
/-rgt-identity99.8%
Simplified99.8%
*-un-lft-identity99.8%
sqrt-undiv99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Final simplification99.7%
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 5.0000000000000001e-9Initial program 39.2%
frac-sub39.3%
div-inv39.3%
*-un-lft-identity39.3%
+-commutative39.3%
*-rgt-identity39.3%
metadata-eval39.3%
frac-times39.3%
un-div-inv39.3%
pow1/239.3%
pow-flip39.3%
metadata-eval39.3%
+-commutative39.3%
Applied egg-rr39.3%
associate-*r/39.3%
*-rgt-identity39.3%
times-frac39.3%
div-sub39.3%
*-inverses39.3%
/-rgt-identity39.3%
Simplified39.3%
Taylor expanded in x around inf 99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
unpow299.4%
Simplified99.4%
if 5.0000000000000001e-9 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.3%
frac-sub99.3%
div-inv99.3%
*-un-lft-identity99.3%
+-commutative99.3%
*-rgt-identity99.3%
metadata-eval99.3%
frac-times99.3%
un-div-inv99.3%
pow1/299.3%
pow-flip99.8%
metadata-eval99.8%
+-commutative99.8%
Applied egg-rr99.8%
associate-*r/99.8%
*-rgt-identity99.8%
times-frac99.8%
div-sub99.8%
*-inverses99.8%
/-rgt-identity99.8%
Simplified99.8%
*-un-lft-identity99.8%
sqrt-undiv99.8%
Applied egg-rr99.8%
*-lft-identity99.8%
Simplified99.8%
Final simplification99.6%
if (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) < 5.0000000000000001e-9Initial program 39.2%
frac-sub39.3%
div-inv39.3%
*-un-lft-identity39.3%
+-commutative39.3%
*-rgt-identity39.3%
metadata-eval39.3%
frac-times39.3%
un-div-inv39.3%
pow1/239.3%
pow-flip39.3%
metadata-eval39.3%
+-commutative39.3%
Applied egg-rr39.3%
associate-*r/39.3%
*-rgt-identity39.3%
times-frac39.3%
div-sub39.3%
*-inverses39.3%
/-rgt-identity39.3%
Simplified39.3%
Taylor expanded in x around inf 99.4%
associate-*r/99.4%
metadata-eval99.4%
associate-*r/99.4%
metadata-eval99.4%
unpow299.4%
Simplified99.4%
if 5.0000000000000001e-9 < (-.f64 (/.f64 1 (sqrt.f64 x)) (/.f64 1 (sqrt.f64 (+.f64 x 1)))) Initial program 99.3%
*-un-lft-identity99.3%
clear-num99.3%
associate-/r/99.3%
prod-diff99.3%
*-un-lft-identity99.3%
fma-neg99.3%
*-un-lft-identity99.3%
inv-pow99.3%
sqrt-pow299.7%
metadata-eval99.7%
pow1/299.7%
pow-flip99.8%
+-commutative99.8%
metadata-eval99.8%
Applied egg-rr99.8%
fma-udef99.8%
distribute-lft1-in99.8%
metadata-eval99.8%
mul0-lft99.8%
+-rgt-identity99.8%
Simplified99.8%
Final simplification99.6%
if x < 1.44999999999999996Initial program 99.5%
Taylor expanded in x around 0 98.5%
add-log-exp5.1%
*-un-lft-identity5.1%
log-prod5.1%
metadata-eval5.1%
add-log-exp98.5%
pow1/298.5%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
+-lft-identity99.0%
Simplified99.0%
if 1.44999999999999996 < x Initial program 40.4%
frac-sub40.5%
div-inv40.5%
*-un-lft-identity40.5%
+-commutative40.5%
*-rgt-identity40.5%
metadata-eval40.5%
frac-times40.5%
un-div-inv40.5%
pow1/240.5%
pow-flip40.5%
metadata-eval40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate-*r/40.5%
*-rgt-identity40.5%
times-frac40.5%
div-sub40.5%
*-inverses40.5%
/-rgt-identity40.5%
Simplified40.5%
Taylor expanded in x around inf 98.0%
associate-*r/98.0%
metadata-eval98.0%
associate-*r/98.0%
metadata-eval98.0%
unpow298.0%
Simplified98.0%
Final simplification98.5%
if x < 1.67999999999999994Initial program 99.5%
Taylor expanded in x around 0 98.5%
add-log-exp5.1%
*-un-lft-identity5.1%
log-prod5.1%
metadata-eval5.1%
add-log-exp98.5%
pow1/298.5%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
+-lft-identity99.0%
Simplified99.0%
if 1.67999999999999994 < x Initial program 40.4%
frac-sub40.5%
div-inv40.5%
*-un-lft-identity40.5%
+-commutative40.5%
*-rgt-identity40.5%
metadata-eval40.5%
frac-times40.5%
un-div-inv40.5%
pow1/240.5%
pow-flip40.5%
metadata-eval40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate-*r/40.5%
*-rgt-identity40.5%
times-frac40.5%
div-sub40.5%
*-inverses40.5%
/-rgt-identity40.5%
Simplified40.5%
Taylor expanded in x around inf 96.5%
associate-*l/96.6%
Applied egg-rr96.6%
Final simplification97.8%
if x < 1Initial program 99.5%
inv-pow99.5%
pow1/299.5%
pow-pow100.0%
add-exp-log92.6%
pow-exp92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 98.9%
if 1 < x Initial program 40.4%
frac-sub40.5%
div-inv40.5%
*-un-lft-identity40.5%
+-commutative40.5%
*-rgt-identity40.5%
metadata-eval40.5%
frac-times40.5%
un-div-inv40.5%
pow1/240.5%
pow-flip40.5%
metadata-eval40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate-*r/40.5%
*-rgt-identity40.5%
times-frac40.5%
div-sub40.5%
*-inverses40.5%
/-rgt-identity40.5%
Simplified40.5%
Taylor expanded in x around inf 96.5%
associate-*l/96.6%
Applied egg-rr96.6%
Final simplification97.8%
if x < 0.660000000000000031Initial program 99.5%
inv-pow99.5%
pow1/299.5%
pow-pow100.0%
add-exp-log92.6%
pow-exp92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 98.2%
if 0.660000000000000031 < x Initial program 40.4%
frac-sub40.5%
div-inv40.5%
*-un-lft-identity40.5%
+-commutative40.5%
*-rgt-identity40.5%
metadata-eval40.5%
frac-times40.5%
un-div-inv40.5%
pow1/240.5%
pow-flip40.5%
metadata-eval40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate-*r/40.5%
*-rgt-identity40.5%
times-frac40.5%
div-sub40.5%
*-inverses40.5%
/-rgt-identity40.5%
Simplified40.5%
Taylor expanded in x around inf 96.5%
Final simplification97.4%
if x < 0.660000000000000031Initial program 99.5%
inv-pow99.5%
pow1/299.5%
pow-pow100.0%
add-exp-log92.6%
pow-exp92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 98.2%
if 0.660000000000000031 < x Initial program 40.4%
frac-sub40.5%
div-inv40.5%
*-un-lft-identity40.5%
+-commutative40.5%
*-rgt-identity40.5%
metadata-eval40.5%
frac-times40.5%
un-div-inv40.5%
pow1/240.5%
pow-flip40.5%
metadata-eval40.5%
+-commutative40.5%
Applied egg-rr40.5%
associate-*r/40.5%
*-rgt-identity40.5%
times-frac40.5%
div-sub40.5%
*-inverses40.5%
/-rgt-identity40.5%
Simplified40.5%
Taylor expanded in x around inf 96.5%
associate-*l/96.6%
Applied egg-rr96.6%
Final simplification97.4%
if x < 0.80000000000000004Initial program 99.5%
inv-pow99.5%
pow1/299.5%
pow-pow100.0%
add-exp-log92.6%
pow-exp92.6%
metadata-eval92.6%
Applied egg-rr92.6%
Taylor expanded in x around 0 98.2%
if 0.80000000000000004 < x Initial program 40.4%
inv-pow40.4%
pow1/240.4%
pow-pow29.9%
add-exp-log8.2%
pow-exp8.3%
metadata-eval8.3%
Applied egg-rr8.3%
Taylor expanded in x around inf 5.5%
pow1/25.5%
inv-pow5.5%
pow-pow5.5%
metadata-eval5.5%
sqr-pow5.5%
pow-prod-down37.2%
metadata-eval37.2%
Applied egg-rr37.2%
Final simplification67.7%
Initial program 69.9%
inv-pow69.9%
pow1/269.9%
pow-pow65.0%
add-exp-log50.4%
pow-exp50.4%
metadata-eval50.4%
Applied egg-rr50.4%
Taylor expanded in x around inf 51.0%
Final simplification51.0%
Initial program 69.9%
frac-sub70.0%
div-inv70.0%
*-un-lft-identity70.0%
+-commutative70.0%
*-rgt-identity70.0%
metadata-eval70.0%
frac-times70.0%
un-div-inv70.0%
pow1/270.0%
pow-flip70.2%
metadata-eval70.2%
+-commutative70.2%
Applied egg-rr70.2%
associate-*r/70.2%
*-rgt-identity70.2%
times-frac70.2%
div-sub70.3%
*-inverses70.3%
/-rgt-identity70.3%
Simplified70.3%
Taylor expanded in x around 0 51.1%
Final simplification51.1%
Initial program 69.9%
inv-pow69.9%
pow1/269.9%
pow-pow65.0%
add-exp-log50.4%
pow-exp50.4%
metadata-eval50.4%
Applied egg-rr50.4%
Taylor expanded in x around 0 51.1%
Taylor expanded in x around inf 3.8%
Final simplification3.8%
herbie shell --seed 2023166
(FPCore (x)
:name "2isqrt (example 3.6)"
:precision binary64
:herbie-target
(/ 1.0 (+ (* (+ x 1.0) (sqrt x)) (* x (sqrt (+ x 1.0)))))
(- (/ 1.0 (sqrt x)) (/ 1.0 (sqrt (+ x 1.0)))))