Average Error: 0.2 → 0.2
Time: 16.0s
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 r33809402 = x;
        double r33809403 = 3.0;
        double r33809404 = r33809402 * r33809403;
        double r33809405 = y;
        double r33809406 = r33809404 * r33809405;
        double r33809407 = z;
        double r33809408 = r33809406 - r33809407;
        return r33809408;
}

double f(double x, double y, double z) {
        double r33809409 = y;
        double r33809410 = 3.0;
        double r33809411 = r33809409 * r33809410;
        double r33809412 = x;
        double r33809413 = r33809411 * r33809412;
        double r33809414 = z;
        double r33809415 = r33809413 - r33809414;
        return r33809415;
}

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 +o rules:numerics
(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))