Average Error: 11.5 → 1.1
Time: 9.3s
Precision: binary64
Cost: 832
Math TeX FPCore C \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
↓
\[x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}}\]
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} ↓
x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}} (FPCore (x y z t)
:precision binary64
(- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t))))) ↓
(FPCore (x y z t) :precision binary64 (- x (/ y (- z (/ y (/ 2.0 (/ t z))))))) double code(double x, double y, double z, double t) {
return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
↓
double code(double x, double y, double z, double t) {
return x - (y / (z - (y / (2.0 / (t / z)))));
}
Try it out Enter valid numbers for all inputs
Target Original 11.5 Target 0.1 Herbie 1.1
\[x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}\]
Alternatives Alternative 1 Error 3.0 Cost 40768
\[x - \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}} \cdot \sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}}\]
Alternative 2 Error 43.4 Cost 27328
\[\left(\sqrt{\frac{y}{z - \frac{t \cdot y}{z \cdot 2}}} + \sqrt{x}\right) \cdot \left(\sqrt{x} - \sqrt{\frac{y}{z - \frac{t \cdot y}{z \cdot 2}}}\right)\]
Alternative 3 Error 3.0 Cost 21440
\[x - \frac{1}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}} \cdot \sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}} \cdot \frac{y}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}}\]
Alternative 4 Error 3.0 Cost 21312
\[x - \frac{\frac{y}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}} \cdot \sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}}}{\sqrt[3]{z - \frac{t \cdot y}{z \cdot 2}}}\]
Alternative 5 Error 33.0 Cost 14528
\[\sqrt{x - \frac{y}{z - \frac{t \cdot y}{z \cdot 2}}} \cdot \sqrt{x - \frac{y}{z - \frac{t \cdot y}{z \cdot 2}}}\]
Alternative 6 Error 33.6 Cost 14272
\[x - \frac{\frac{y}{\sqrt{z - \frac{t \cdot y}{z \cdot 2}}}}{\sqrt{z - \frac{t \cdot y}{z \cdot 2}}}\]
Alternative 7 Error 1.2 Cost 13888
\[x - \frac{y}{z - \frac{1}{\sqrt{2}} \cdot \left(\frac{t}{z} \cdot \frac{y}{\sqrt{2}}\right)}\]
Alternative 8 Error 32.9 Cost 13760
\[x - \sqrt{y} \cdot \frac{\sqrt{y}}{z - \frac{t \cdot y}{z \cdot 2}}\]
Alternative 9 Error 33.4 Cost 13760
\[x - \frac{y}{z - \left(\frac{y}{2} \cdot \sqrt{t}\right) \cdot \frac{\sqrt{t}}{z}}\]
Alternative 10 Error 8.7 Cost 13696
\[x - \sqrt[3]{{\left(\frac{y}{z - \frac{t \cdot y}{z \cdot 2}}\right)}^{3}}\]
Alternative 11 Error 23.7 Cost 13632
\[x - e^{\log \left(\frac{y}{z - \frac{t \cdot y}{z \cdot 2}}\right)}\]
Alternative 12 Error 19.4 Cost 1984
\[x - \frac{y}{z \cdot z - \left(y \cdot \frac{t}{z}\right) \cdot \frac{t \cdot y}{z \cdot 4}} \cdot \left(z + \frac{t \cdot y}{z \cdot 2}\right)\]
Alternative 13 Error 11.5 Cost 1088
\[x - \frac{z \cdot \left(y \cdot 2\right)}{z \cdot \left(z \cdot 2\right) - t \cdot y}\]
Alternative 14 Error 2.8 Cost 960
\[x - \frac{y}{z - \frac{1}{\frac{z \cdot 2}{t \cdot y}}}\]
Alternative 15 Error 2.8 Cost 960
\[x - y \cdot \frac{1}{z - \frac{t \cdot y}{z \cdot 2}}\]
Alternative 16 Error 2.8 Cost 960
\[x - \frac{1}{\frac{z - \frac{t \cdot y}{z \cdot 2}}{y}}\]
Alternative 17 Error 1.1 Cost 832
\[x - \frac{y}{z - \frac{t}{z} \cdot \frac{y}{2}}\]
Alternative 18 Error 2.7 Cost 832
\[x - \frac{y}{z - \frac{t \cdot y}{z \cdot 2}}\]
Alternative 19 Error 49.6 Cost 768
\[-\frac{y}{z - \frac{t \cdot y}{z \cdot 2}}\]
Alternative 20 Error 48.2 Cost 768
\[\frac{-y}{z - \left(y \cdot \frac{t}{z}\right) \cdot 0.5}\]
Alternative 21 Error 24.0 Cost 448
\[x - -2 \cdot \frac{z}{t}\]
Alternative 22 Error 23.9 Cost 320
\[x - \frac{y}{z}\]
Alternative 23 Error 15.5 Cost 64
\[x\]
Alternative 24 Error 61.6 Cost 64
\[1\]
Alternative 25 Error 61.9 Cost 64
\[0\]
Alternative 26 Error 61.7 Cost 64
\[-1\]
Error Derivation Initial program 11.5
\[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}\]
Simplified2.7
\[\leadsto \color{blue}{x - \frac{y}{z - \frac{y \cdot t}{2 \cdot z}}}\]
Using strategy rm Applied associate-/l*_binary64_16732 1.1
\[\leadsto x - \frac{y}{z - \color{blue}{\frac{y}{\frac{2 \cdot z}{t}}}}\]
Simplified1.1
\[\leadsto x - \frac{y}{z - \frac{y}{\color{blue}{\frac{2}{\frac{t}{z}}}}}\]
Simplified1.1
\[\leadsto \color{blue}{x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}}}\]
Final simplification1.1
\[\leadsto x - \frac{y}{z - \frac{y}{\frac{2}{\frac{t}{z}}}}\]
Reproduce herbie shell --seed 2021022
(FPCore (x y z t)
:name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
:precision binary64
:herbie-target
(- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))
(- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))