Average Error: 0.2 → 0.2
Time: 16.1s
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 r33393526 = x;
        double r33393527 = 3.0;
        double r33393528 = r33393526 * r33393527;
        double r33393529 = y;
        double r33393530 = r33393528 * r33393529;
        double r33393531 = z;
        double r33393532 = r33393530 - r33393531;
        return r33393532;
}

double f(double x, double y, double z) {
        double r33393533 = y;
        double r33393534 = 3.0;
        double r33393535 = r33393533 * r33393534;
        double r33393536 = x;
        double r33393537 = r33393535 * r33393536;
        double r33393538 = z;
        double r33393539 = r33393537 - r33393538;
        return r33393539;
}

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))