Average Error: 0.2 → 0.1
Time: 1.8s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[x \cdot \left(3 \cdot y\right) - z\]
\left(x \cdot 3\right) \cdot y - z
x \cdot \left(3 \cdot y\right) - z
double f(double x, double y, double z) {
        double r789588 = x;
        double r789589 = 3.0;
        double r789590 = r789588 * r789589;
        double r789591 = y;
        double r789592 = r789590 * r789591;
        double r789593 = z;
        double r789594 = r789592 - r789593;
        return r789594;
}

double f(double x, double y, double z) {
        double r789595 = x;
        double r789596 = 3.0;
        double r789597 = y;
        double r789598 = r789596 * r789597;
        double r789599 = r789595 * r789598;
        double r789600 = z;
        double r789601 = r789599 - r789600;
        return r789601;
}

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.2
Target0.1
Herbie0.1
\[x \cdot \left(3 \cdot y\right) - z\]

Derivation

  1. Initial program 0.2

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

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

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

Reproduce

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

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

  (- (* (* x 3) y) z))