Average Error: 0.2 → 0.1
Time: 11.7s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[\left(y \cdot 3\right) \cdot x - z\]
\left(x \cdot 3\right) \cdot y - z
\left(y \cdot 3\right) \cdot x - z
double f(double x, double y, double z) {
        double r33885400 = x;
        double r33885401 = 3.0;
        double r33885402 = r33885400 * r33885401;
        double r33885403 = y;
        double r33885404 = r33885402 * r33885403;
        double r33885405 = z;
        double r33885406 = r33885404 - r33885405;
        return r33885406;
}

double f(double x, double y, double z) {
        double r33885407 = y;
        double r33885408 = 3.0;
        double r33885409 = r33885407 * r33885408;
        double r33885410 = x;
        double r33885411 = r33885409 * r33885410;
        double r33885412 = z;
        double r33885413 = r33885411 - r33885412;
        return r33885413;
}

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

Reproduce

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

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

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