Average Error: 0.2 → 0.2
Time: 1.9s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[x \cdot \left(3 \cdot y\right) - z\]
\left(x \cdot 3\right) \cdot y - z
x \cdot \left(3 \cdot y\right) - z
double f(double x, double y, double z) {
        double r751139 = x;
        double r751140 = 3.0;
        double r751141 = r751139 * r751140;
        double r751142 = y;
        double r751143 = r751141 * r751142;
        double r751144 = z;
        double r751145 = r751143 - r751144;
        return r751145;
}

double f(double x, double y, double z) {
        double r751146 = x;
        double r751147 = 3.0;
        double r751148 = y;
        double r751149 = r751147 * r751148;
        double r751150 = r751146 * r751149;
        double r751151 = z;
        double r751152 = r751150 - r751151;
        return r751152;
}

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 \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.2

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

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

Reproduce

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

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

  (- (* (* x 3) y) z))