
Herbie found 5 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Initial program 72.9%
unpow272.9%
unpow272.9%
difference-of-squares72.8%
*-commutative72.8%
+-commutative72.8%
associate--l+100.0%
+-inverses100.0%
+-rgt-identity100.0%
+-commutative100.0%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
Final simplification100.0%
if x < -1.8999999999999999e-126 or 1.8499999999999999e-113 < x Initial program 31.3%
unpow231.3%
unpow231.3%
difference-of-squares31.2%
*-commutative31.2%
+-commutative31.2%
associate--l+99.9%
+-inverses99.9%
+-rgt-identity99.9%
+-commutative99.9%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in eps around 0 91.1%
if -1.8999999999999999e-126 < x < 1.8499999999999999e-113Initial program 99.1%
unpow299.1%
unpow299.1%
difference-of-squares99.1%
*-commutative99.1%
+-commutative99.1%
associate--l+100.0%
+-inverses100.0%
+-rgt-identity100.0%
+-commutative100.0%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in eps around inf 98.4%
unpow298.4%
Simplified98.4%
Final simplification95.6%
if x < -3.5e-126 or 9.50000000000000004e-110 < x Initial program 31.3%
unpow231.3%
unpow231.3%
difference-of-squares31.2%
*-commutative31.2%
+-commutative31.2%
associate--l+99.9%
+-inverses99.9%
+-rgt-identity99.9%
+-commutative99.9%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
distribute-rgt-in100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 91.1%
count-291.1%
distribute-lft-out91.1%
Simplified91.1%
if -3.5e-126 < x < 9.50000000000000004e-110Initial program 99.1%
unpow299.1%
unpow299.1%
difference-of-squares99.1%
*-commutative99.1%
+-commutative99.1%
associate--l+100.0%
+-inverses100.0%
+-rgt-identity100.0%
+-commutative100.0%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in eps around inf 98.4%
unpow298.4%
Simplified98.4%
Final simplification95.6%
Initial program 72.9%
unpow272.9%
unpow272.9%
difference-of-squares72.8%
*-commutative72.8%
+-commutative72.8%
associate--l+100.0%
+-inverses100.0%
+-rgt-identity100.0%
+-commutative100.0%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
fma-udef100.0%
distribute-rgt-in100.0%
Applied egg-rr100.0%
Final simplification100.0%
Initial program 72.9%
unpow272.9%
unpow272.9%
difference-of-squares72.8%
*-commutative72.8%
+-commutative72.8%
associate--l+100.0%
+-inverses100.0%
+-rgt-identity100.0%
+-commutative100.0%
associate-+r+100.0%
count-2100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in eps around inf 70.8%
unpow270.8%
Simplified70.8%
Final simplification70.8%
herbie shell --seed 2023166
(FPCore (x eps)
:name "ENA, Section 1.4, Exercise 4b, n=2"
:precision binary64
:pre (and (and (<= -1000000000.0 x) (<= x 1000000000.0)) (and (<= -1.0 eps) (<= eps 1.0)))
(- (pow (+ x eps) 2.0) (pow x 2.0)))