Average Error: 0.2 → 0.2
Time: 13.3s
Precision: 64
\[\left(x \cdot 3.0\right) \cdot y - z\]
\[\left(y \cdot 3.0\right) \cdot x - z\]
\left(x \cdot 3.0\right) \cdot y - z
\left(y \cdot 3.0\right) \cdot x - z
double f(double x, double y, double z) {
        double r33595050 = x;
        double r33595051 = 3.0;
        double r33595052 = r33595050 * r33595051;
        double r33595053 = y;
        double r33595054 = r33595052 * r33595053;
        double r33595055 = z;
        double r33595056 = r33595054 - r33595055;
        return r33595056;
}

double f(double x, double y, double z) {
        double r33595057 = y;
        double r33595058 = 3.0;
        double r33595059 = r33595057 * r33595058;
        double r33595060 = x;
        double r33595061 = r33595059 * r33595060;
        double r33595062 = z;
        double r33595063 = r33595061 - r33595062;
        return r33595063;
}

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

Derivation

  1. Initial program 0.2

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

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

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

Reproduce

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