Average Error: 0.1 → 0.2
Time: 7.1s
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 r499268 = x;
        double r499269 = 3.0;
        double r499270 = r499268 * r499269;
        double r499271 = y;
        double r499272 = r499270 * r499271;
        double r499273 = z;
        double r499274 = r499272 - r499273;
        return r499274;
}

double f(double x, double y, double z) {
        double r499275 = x;
        double r499276 = 3.0;
        double r499277 = y;
        double r499278 = r499276 * r499277;
        double r499279 = r499275 * r499278;
        double r499280 = z;
        double r499281 = r499279 - r499280;
        return r499281;
}

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.1
Target0.2
Herbie0.2
\[x \cdot \left(3 \cdot y\right) - z\]

Derivation

  1. Initial program 0.1

    \[\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 2019298 
(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))