Average Error: 0.1 → 0.1
Time: 7.5s
Precision: binary64
Cost: 832
\[\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));
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.1
Target0.1
Herbie0.1
\[\left(3 \cdot z\right) \cdot z + y \cdot x\]

Alternatives

Alternative 1
Error0.3
Cost45888
\[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
Error1.2
Cost21312
\[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
Error1.3
Cost21056
\[\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
Error0.5
Cost20544
\[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
Error31.9
Cost20160
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(\sqrt{z} \cdot \sqrt{z \cdot 3}\right)\]
Alternative 6
Error0.2
Cost20032
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left|z \cdot \sqrt{3}\right|\]
Alternative 7
Error12.6
Cost19904
\[x \cdot y - \left(z \cdot \sqrt{3}\right) \cdot \left|z \cdot \sqrt{3}\right|\]
Alternative 8
Error18.9
Cost14272
\[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
Error19.0
Cost14016
\[\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
Error0.2
Cost13760
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \sqrt{z \cdot \left(z \cdot 3\right)}\]
Alternative 11
Error12.6
Cost13632
\[x \cdot y - \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 12
Error12.0
Cost13632
\[x \cdot y + \sqrt{z \cdot \left(z \cdot 3\right)} \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 13
Error0.3
Cost13504
\[x \cdot y + \left(z \cdot \sqrt{3}\right) \cdot \left(z \cdot \sqrt{3}\right)\]
Alternative 14
Error31.9
Cost13440
\[x \cdot y + \sqrt{z} \cdot \left(3 \cdot {z}^{1.5}\right)\]
Alternative 15
Error0.2
Cost13440
\[x \cdot y + {\left(\sqrt{z \cdot \left(z \cdot 3\right)}\right)}^{2}\]
Alternative 16
Error13.3
Cost13376
\[x \cdot y + {\left(9 \cdot {z}^{4}\right)}^{0.5}\]
Alternative 17
Error13.3
Cost13312
\[x \cdot y + \sqrt{9 \cdot {z}^{4}}\]
Alternative 18
Error27.2
Cost1344
\[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
Error0.1
Cost960
\[z \cdot z + \left(z \cdot z + \left(x \cdot y + z \cdot z\right)\right)\]
Alternative 20
Error0.1
Cost576
\[x \cdot y + z \cdot \left(z \cdot 3\right)\]
Alternative 21
Error35.9
Cost320
\[\left(z \cdot z\right) \cdot 3\]
Alternative 22
Error23.9
Cost192
\[x \cdot y\]
Alternative 23
Error61.3
Cost64
\[1\]
Alternative 24
Error59.2
Cost64
\[0\]
Alternative 25
Error62.2
Cost64
\[-1\]

Error

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot y + z \cdot z\right) + z \cdot z\right) + z \cdot z\]
  2. Using strategy rm
  3. Applied associate-+l+_binary64_106600.1

    \[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + \left(z \cdot z + z \cdot z\right)}\]
  4. Simplified0.1

    \[\leadsto \left(x \cdot y + z \cdot z\right) + \color{blue}{z \cdot \left(z + z\right)}\]
  5. Simplified0.1

    \[\leadsto \color{blue}{\left(x \cdot y + z \cdot z\right) + z \cdot \left(z + z\right)}\]
  6. 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)))