Average Error: 0.1 → 0.1
Time: 4.4s
Precision: binary64
Cost: 448
\[\left(x \cdot 3\right) \cdot y - z\]
\[y \cdot \left(x \cdot 3\right) - z\]
\left(x \cdot 3\right) \cdot y - z
y \cdot \left(x \cdot 3\right) - z
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
(FPCore (x y z) :precision binary64 (- (* y (* x 3.0)) z))
double code(double x, double y, double z) {
	return ((x * 3.0) * y) - z;
}
double code(double x, double y, double z) {
	return (y * (x * 3.0)) - 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
\[x \cdot \left(3 \cdot y\right) - z\]

Alternatives

Alternative 1
Error0.1
Cost448
\[x \cdot \left(y \cdot 3\right) - z\]
Alternative 2
Error17.4
Cost913
\[\begin{array}{l} \mathbf{if}\;z \leq -1.526528477030976 \cdot 10^{-89} \lor \neg \left(z \leq 1.047691412008187 \cdot 10^{-66} \lor \neg \left(z \leq 6.793182366179865 \cdot 10^{+41}\right) \land z \leq 6.454087210450806 \cdot 10^{+68}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(x \cdot 3\right)\\ \end{array}\]
Alternative 3
Error26.9
Cost128
\[-z\]
Alternative 4
Error61.8
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.1

    \[\left(x \cdot 3\right) \cdot y - z\]
  2. Simplified0.1

    \[\leadsto \color{blue}{y \cdot \left(x \cdot 3\right) - z}\]
  3. Final simplification0.1

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

Reproduce

herbie shell --seed 2021044 
(FPCore (x y z)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, B"
  :precision binary64

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

  (- (* (* x 3.0) y) z))