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 r32697757 = x;
        double r32697758 = 3.0;
        double r32697759 = r32697757 * r32697758;
        double r32697760 = y;
        double r32697761 = r32697759 * r32697760;
        double r32697762 = z;
        double r32697763 = r32697761 - r32697762;
        return r32697763;
}

double f(double x, double y, double z) {
        double r32697764 = y;
        double r32697765 = 3.0;
        double r32697766 = r32697764 * r32697765;
        double r32697767 = x;
        double r32697768 = r32697766 * r32697767;
        double r32697769 = z;
        double r32697770 = r32697768 - r32697769;
        return r32697770;
}

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