Average Error: 0.3 → 0.2
Time: 5.3s
Precision: binary64
Cost: 448
\[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
\[y \cdot \left(x \cdot \left(y \cdot 3\right)\right)\]
\left(\left(x \cdot 3\right) \cdot y\right) \cdot y
y \cdot \left(x \cdot \left(y \cdot 3\right)\right)
(FPCore (x y) :precision binary64 (* (* (* x 3.0) y) y))
(FPCore (x y) :precision binary64 (* y (* x (* y 3.0))))
double code(double x, double y) {
	return ((x * 3.0) * y) * y;
}
double code(double x, double y) {
	return y * (x * (y * 3.0));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original0.3
Target0.2
Herbie0.2
\[\left(x \cdot \left(3 \cdot y\right)\right) \cdot y\]

Alternatives

Alternative 1
Error1.2
Cost66176
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{{\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right)}^{2}} \cdot \left(\sqrt[3]{{\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right)}^{2}} \cdot \sqrt[3]{{\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right)}^{2}}\right)\right)\]
Alternative 2
Error1.2
Cost46848
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}} \cdot {\left(\sqrt[3]{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}}\right)}^{2}\right)\right)\]
Alternative 3
Error1.5
Cost39936
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}} \cdot {\left(\sqrt[3]{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}}\right)}^{5}\right)\]
Alternative 4
Error22.5
Cost39936
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}} \cdot {\left(\sqrt{\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}}\right)}^{3}\right)\]
Alternative 5
Error1.0
Cost33472
\[\left(\sqrt[3]{y} \cdot \sqrt[3]{x \cdot \left(3 \cdot y\right)}\right) \cdot \left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{x \cdot \left(3 \cdot y\right)}\right)\right)\]
Alternative 6
Error0.9
Cost33472
\[\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right) \cdot \left(\sqrt[3]{y} \cdot \left(\sqrt[3]{3} \cdot \sqrt[3]{x \cdot y}\right)\right)\]
Alternative 7
Error0.9
Cost27072
\[\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right) \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{x \cdot \left(3 \cdot y\right)}\right)\]
Alternative 8
Error0.9
Cost20672
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right)\]
Alternative 9
Error11.2
Cost20672
\[\sqrt[3]{\left(x \cdot 3\right) \cdot \left(y \cdot y\right)} \cdot \left(\sqrt[3]{\left(x \cdot 3\right) \cdot \left(y \cdot y\right)} \cdot \sqrt[3]{\left(x \cdot 3\right) \cdot \left(y \cdot y\right)}\right)\]
Alternative 10
Error0.9
Cost20416
\[y \cdot \left(\sqrt[3]{\left(x \cdot 3\right) \cdot y} \cdot \left(\sqrt[3]{\left(x \cdot 3\right) \cdot y} \cdot \sqrt[3]{\left(x \cdot 3\right) \cdot y}\right)\right)\]
Alternative 11
Error0.9
Cost20224
\[\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot {\left(\sqrt[3]{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\right)}^{2}\]
Alternative 12
Error0.9
Cost19904
\[y \cdot \left(\sqrt[3]{y} \cdot \left(\left(x \cdot 3\right) \cdot \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right)\right)\]
Alternative 13
Error22.2
Cost13760
\[\sqrt{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)} \cdot \sqrt{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\]
Alternative 14
Error27.1
Cost13760
\[\sqrt{\left(x \cdot 3\right) \cdot \left(y \cdot y\right)} \cdot \sqrt{\left(x \cdot 3\right) \cdot \left(y \cdot y\right)}\]
Alternative 15
Error27.7
Cost13632
\[y \cdot \left(\sqrt{\left(x \cdot 3\right) \cdot y} \cdot \sqrt{\left(x \cdot 3\right) \cdot y}\right)\]
Alternative 16
Error32.2
Cost13376
\[y \cdot \left(\sqrt{y} \cdot \left(\left(x \cdot 3\right) \cdot \sqrt{y}\right)\right)\]
Alternative 17
Error18.6
Cost13312
\[y \cdot \sqrt[3]{{\left(\left(x \cdot 3\right) \cdot y\right)}^{3}}\]
Alternative 18
Error29.3
Cost13312
\[\sqrt[3]{{\left(\left(x \cdot 3\right) \cdot \left(y \cdot y\right)\right)}^{3}}\]
Alternative 19
Error10.7
Cost448
\[x \cdot \left(3 \cdot \left(y \cdot y\right)\right)\]
Alternative 20
Error10.7
Cost448
\[\left(x \cdot 3\right) \cdot \left(y \cdot y\right)\]
Alternative 21
Error0.3
Cost448
\[y \cdot \left(\left(x \cdot 3\right) \cdot y\right)\]
Alternative 22
Error0.2
Cost448
\[y \cdot \left(x \cdot \left(3 \cdot y\right)\right)\]
Alternative 23
Error61.8
Cost64
\[1\]
Alternative 24
Error41.7
Cost64
\[0\]
Alternative 25
Error61.8
Cost64
\[-1\]

Error

Derivation

  1. Initial program 0.3

    \[\left(\left(x \cdot 3\right) \cdot y\right) \cdot y\]
  2. Using strategy rm
  3. Applied associate-*l*_binary64_193260.2

    \[\leadsto \color{blue}{\left(x \cdot \left(3 \cdot y\right)\right)} \cdot y\]
  4. Simplified0.2

    \[\leadsto \color{blue}{y \cdot \left(x \cdot \left(3 \cdot y\right)\right)}\]
  5. Final simplification0.2

    \[\leadsto y \cdot \left(x \cdot \left(y \cdot 3\right)\right)\]

Reproduce

herbie shell --seed 2021042 
(FPCore (x y)
  :name "Diagrams.Segment:$catParam from diagrams-lib-1.3.0.3, B"
  :precision binary64

  :herbie-target
  (* (* x (* 3.0 y)) y)

  (* (* (* x 3.0) y) y))