Average Error: 0.2 → 0.1
Time: 1.5s
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 r816171 = x;
        double r816172 = 3.0;
        double r816173 = r816171 * r816172;
        double r816174 = y;
        double r816175 = r816173 * r816174;
        double r816176 = z;
        double r816177 = r816175 - r816176;
        return r816177;
}

double f(double x, double y, double z) {
        double r816178 = x;
        double r816179 = 3.0;
        double r816180 = y;
        double r816181 = r816179 * r816180;
        double r816182 = r816178 * r816181;
        double r816183 = z;
        double r816184 = r816182 - r816183;
        return r816184;
}

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.1
Herbie0.1
\[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.1

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

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

Reproduce

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