
Results
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 98.2%
flip--98.1%
div-inv97.9%
add-sqr-sqrt97.5%
sub-neg97.5%
add-sqr-sqrt97.5%
hypot-def97.5%
Applied egg-rr97.5%
associate-*r/97.6%
*-rgt-identity97.6%
associate--r-99.2%
+-inverses99.2%
+-lft-identity99.2%
Simplified99.2%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 9.4%
flip--9.3%
div-inv9.3%
add-sqr-sqrt9.4%
sub-neg9.4%
add-sqr-sqrt2.5%
hypot-def2.5%
Applied egg-rr2.5%
associate-*r/2.5%
*-rgt-identity2.5%
associate--r-47.7%
+-inverses47.7%
+-lft-identity47.7%
Simplified47.7%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt98.8%
*-commutative98.8%
associate-*r*98.8%
metadata-eval98.8%
associate-*r/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.8%
Applied egg-rr98.8%
Final simplification99.1%
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 98.2%
sub-neg98.2%
+-commutative98.2%
add-sqr-sqrt98.3%
hypot-def98.3%
Applied egg-rr98.3%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 9.4%
flip--9.3%
div-inv9.3%
add-sqr-sqrt9.4%
sub-neg9.4%
add-sqr-sqrt2.5%
hypot-def2.5%
Applied egg-rr2.5%
associate-*r/2.5%
*-rgt-identity2.5%
associate--r-47.7%
+-inverses47.7%
+-lft-identity47.7%
Simplified47.7%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt98.8%
*-commutative98.8%
associate-*r*98.8%
metadata-eval98.8%
associate-*r/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.8%
Applied egg-rr98.8%
Final simplification98.5%
if (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) < -9.9999999999999997e-155Initial program 98.2%
if -9.9999999999999997e-155 < (-.f64 x (sqrt.f64 (-.f64 (*.f64 x x) eps))) Initial program 9.4%
flip--9.3%
div-inv9.3%
add-sqr-sqrt9.4%
sub-neg9.4%
add-sqr-sqrt2.5%
hypot-def2.5%
Applied egg-rr2.5%
associate-*r/2.5%
*-rgt-identity2.5%
associate--r-47.7%
+-inverses47.7%
+-lft-identity47.7%
Simplified47.7%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt98.8%
*-commutative98.8%
associate-*r*98.8%
metadata-eval98.8%
associate-*r/98.8%
*-commutative98.8%
fma-def98.8%
Simplified98.8%
fma-udef98.8%
Applied egg-rr98.8%
Final simplification98.4%
if x < 1.62000000000000004e-111Initial program 98.8%
Taylor expanded in x around 0 96.7%
neg-mul-196.7%
Simplified96.7%
if 1.62000000000000004e-111 < x Initial program 28.7%
flip--28.6%
div-inv28.6%
add-sqr-sqrt28.6%
sub-neg28.6%
add-sqr-sqrt24.7%
hypot-def24.7%
Applied egg-rr24.7%
associate-*r/24.6%
*-rgt-identity24.6%
associate--r-61.9%
+-inverses61.9%
+-lft-identity61.9%
Simplified61.9%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt81.0%
*-commutative81.0%
associate-*r*81.0%
metadata-eval81.0%
associate-*r/81.0%
*-commutative81.0%
fma-def81.0%
Simplified81.0%
Taylor expanded in x around 0 81.0%
Final simplification89.9%
Initial program 68.4%
flip--68.3%
div-inv68.1%
add-sqr-sqrt67.9%
sub-neg67.9%
add-sqr-sqrt65.6%
hypot-def65.6%
Applied egg-rr65.6%
associate-*r/65.7%
*-rgt-identity65.7%
associate--r-81.9%
+-inverses81.9%
+-lft-identity81.9%
Simplified81.9%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt39.6%
*-commutative39.6%
associate-*r*39.6%
metadata-eval39.6%
associate-*r/39.6%
*-commutative39.6%
fma-def39.6%
Simplified39.6%
fma-udef39.6%
Applied egg-rr39.6%
Final simplification39.6%
Initial program 68.4%
flip--68.3%
div-inv68.1%
add-sqr-sqrt67.9%
sub-neg67.9%
add-sqr-sqrt65.6%
hypot-def65.6%
Applied egg-rr65.6%
associate-*r/65.7%
*-rgt-identity65.7%
associate--r-81.9%
+-inverses81.9%
+-lft-identity81.9%
Simplified81.9%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt39.6%
*-commutative39.6%
associate-*r*39.6%
metadata-eval39.6%
associate-*r/39.6%
*-commutative39.6%
fma-def39.6%
Simplified39.6%
Taylor expanded in x around 0 39.6%
Final simplification39.6%
Initial program 68.4%
Taylor expanded in x around inf 38.2%
Final simplification38.2%
Initial program 68.4%
flip--68.3%
div-inv68.1%
add-sqr-sqrt67.9%
sub-neg67.9%
add-sqr-sqrt65.6%
hypot-def65.6%
Applied egg-rr65.6%
associate-*r/65.7%
*-rgt-identity65.7%
associate--r-81.9%
+-inverses81.9%
+-lft-identity81.9%
Simplified81.9%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt39.6%
*-commutative39.6%
associate-*r*39.6%
metadata-eval39.6%
associate-*r/39.6%
*-commutative39.6%
fma-def39.6%
Simplified39.6%
Taylor expanded in eps around inf 5.5%
*-commutative5.5%
Simplified5.5%
Final simplification5.5%
Initial program 68.4%
flip--68.3%
div-inv68.1%
add-sqr-sqrt67.9%
sub-neg67.9%
add-sqr-sqrt65.6%
hypot-def65.6%
Applied egg-rr65.6%
associate-*r/65.7%
*-rgt-identity65.7%
associate--r-81.9%
+-inverses81.9%
+-lft-identity81.9%
Simplified81.9%
Taylor expanded in x around inf 0.0%
associate-*r/0.0%
unpow20.0%
rem-square-sqrt39.6%
*-commutative39.6%
associate-*r*39.6%
metadata-eval39.6%
associate-*r/39.6%
*-commutative39.6%
fma-def39.6%
Simplified39.6%
Taylor expanded in eps around inf 10.7%
*-commutative10.7%
associate-*l/10.7%
*-lft-identity10.7%
times-frac10.7%
rem-square-sqrt3.3%
associate-*r/3.3%
/-rgt-identity3.3%
rem-square-sqrt10.7%
Simplified10.7%
Taylor expanded in eps around 0 10.7%
Final simplification10.7%
herbie shell --seed 2023167
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4d"
:precision binary64
:pre (and (and (<= 0.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
:herbie-target
(/ eps (+ x (sqrt (- (* x x) eps))))
(- x (sqrt (- (* x x) eps))))