Average Error: 0.1 → 0.1
Time: 7.5s
Precision: binary64
Cost: 832
Math TeX FPCore C \[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
↓
\[\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)\]
\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z ↓
\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right) (FPCore (x y z)
:precision binary64
(+ (+ (+ (* x y) (* z z)) (* z z)) (* z z))) ↓
(FPCore (x y z) :precision binary64 (+ (+ (* x y) (* z z)) (* z (+ z z)))) double code(double x, double y, double z) {
return (((x * y) + (z * z)) + (z * z)) + (z * z);
}
↓
double code(double x, double y, double z) {
return ((x * y) + (z * z)) + (z * (z + z));
}
Try it out Enter valid numbers for all inputs
Target Original 0.1 Target 0.1 Herbie 0.1
\[\left(3 \cdot z\right) \cdot z + y \cdot x\]
Alternatives Alternative 1 Error 0.3 Cost 45888
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(\sqrt{\left|z \cdot \sqrt{3}\right|} \cdot \sqrt{\left|z \cdot \sqrt{3}\right|}\right)\]
Alternative 2 Error 1.2 Cost 21312
\[z \cdot z + \sqrt[3]{x \cdot y + z \cdot \left(z + z\right)} \cdot \left(\sqrt[3]{x \cdot y + z \cdot \left(z + z\right)} \cdot \sqrt[3]{x \cdot y + z \cdot \left(z + z\right)}\right)\]
Alternative 3 Error 1.3 Cost 21056
\[\sqrt[3]{x \cdot y + \left(z \cdot z\right) \cdot 3} \cdot \left(\sqrt[3]{x \cdot y + \left(z \cdot z\right) \cdot 3} \cdot \sqrt[3]{x \cdot y + \left(z \cdot z\right) \cdot 3}\right)\]
Alternative 4 Error 0.5 Cost 20544
\[x \cdot y + \sqrt[3]{z \cdot \left(z \cdot 3\right)} \cdot \left(\sqrt[3]{z \cdot \left(z \cdot 3\right)} \cdot \sqrt[3]{z \cdot \left(z \cdot 3\right)}\right)\]
Alternative 5 Error 31.9 Cost 20160
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(\sqrt{z} \cdot \sqrt{z \cdot 3}\right)\]
Alternative 6 Error 0.2 Cost 20032
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left|z \cdot \sqrt{3}\right|\]
Alternative 7 Error 12.6 Cost 19904
\[x \cdot y - \left(z \cdot \sqrt{3}\right) \cdot \left|z \cdot \sqrt{3}\right|\]
Alternative 8 Error 18.9 Cost 14272
\[z \cdot z + \sqrt{x \cdot y + z \cdot \left(z + z\right)} \cdot \sqrt{x \cdot y + z \cdot \left(z + z\right)}\]
Alternative 9 Error 19.0 Cost 14016
\[\sqrt{x \cdot y + \left(z \cdot z\right) \cdot 3} \cdot \sqrt{x \cdot y + \left(z \cdot z\right) \cdot 3}\]
Alternative 10 Error 0.2 Cost 13760
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \sqrt{z \cdot \left(z \cdot 3\right)}\]
Alternative 11 Error 12.6 Cost 13632
\[x \cdot y - \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 12 Error 12.0 Cost 13632
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 13 Error 0.3 Cost 13504
\[x \cdot y + \left(z \cdot \sqrt{3}\right) \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 14 Error 31.9 Cost 13440
\[x \cdot y + \sqrt{z} \cdot \left(3 \cdot {z}^{1.5}\right)\]
Alternative 15 Error 0.2 Cost 13440
\[x \cdot y + {\left(\sqrt{z \cdot \left(z \cdot 3\right)}\right)}^{2}\]
Alternative 16 Error 13.3 Cost 13376
\[x \cdot y + {\left(9 \cdot {z}^{4}\right)}^{0.5}\]
Alternative 17 Error 13.3 Cost 13312
\[x \cdot y + \sqrt{9 \cdot {z}^{4}}\]
Alternative 18 Error 27.2 Cost 1344
\[z \cdot z + \frac{\left(x \cdot y\right) \cdot \left(x \cdot y + z \cdot \left(z + z\right)\right)}{x \cdot y}\]
Alternative 19 Error 0.1 Cost 960
\[z \cdot z + \left(z \cdot z + \left(x \cdot y + z \cdot z\right)\right)\]
Alternative 20 Error 0.1 Cost 576
\[x \cdot y + z \cdot \left(z \cdot 3\right)\]
Alternative 21 Error 35.9 Cost 320
\[\left(z \cdot z\right) \cdot 3\]
Alternative 22 Error 23.9 Cost 192
\[x \cdot y\]
Alternative 23 Error 61.3 Cost 64
\[1\]
Alternative 24 Error 59.2 Cost 64
\[0\]
Alternative 25 Error 62.2 Cost 64
\[-1\]
Error Derivation Initial program 0.1
\[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
Using strategy rm Applied associate-+l+_binary64_10660 0.1
\[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + \left(z \cdot z + z \cdot z\right)}\]
Simplified0.1
\[\leadsto \left(x \cdot y + z \cdot z\right) + \color{blue}{z \cdot \left(z + z\right)}\]
Simplified0.1
\[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)}\]
Final simplification0.1
\[\leadsto \left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)\]
Reproduce herbie shell --seed 2021042
(FPCore (x y z)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, A"
:precision binary64
:herbie-target
(+ (* (* 3.0 z) z) (* y x))
(+ (+ (+ (* x y) (* z z)) (* z z)) (* z z)))