Average Error: 0.2 → 0.1
Time: 8.7s
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 r38713356 = x;
        double r38713357 = 3.0;
        double r38713358 = r38713356 * r38713357;
        double r38713359 = y;
        double r38713360 = r38713358 * r38713359;
        double r38713361 = z;
        double r38713362 = r38713360 - r38713361;
        return r38713362;
}

double f(double x, double y, double z) {
        double r38713363 = y;
        double r38713364 = 3.0;
        double r38713365 = r38713363 * r38713364;
        double r38713366 = x;
        double r38713367 = r38713365 * r38713366;
        double r38713368 = z;
        double r38713369 = r38713367 - r38713368;
        return r38713369;
}

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.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.1

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

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

Reproduce

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