Average Error: 0.1 → 0.2
Time: 6.5s
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 r533685 = x;
        double r533686 = 3.0;
        double r533687 = r533685 * r533686;
        double r533688 = y;
        double r533689 = r533687 * r533688;
        double r533690 = z;
        double r533691 = r533689 - r533690;
        return r533691;
}

double f(double x, double y, double z) {
        double r533692 = x;
        double r533693 = 3.0;
        double r533694 = y;
        double r533695 = r533693 * r533694;
        double r533696 = r533692 * r533695;
        double r533697 = z;
        double r533698 = r533696 - r533697;
        return r533698;
}

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

Derivation

  1. Initial program 0.1

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

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

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

Reproduce

herbie shell --seed 2019297 
(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))