Average Error: 0.2 → 0.1
Time: 11.8s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[\left(y \cdot 3\right) \cdot x - z\]
\left(x \cdot 3\right) \cdot y - z
\left(y \cdot 3\right) \cdot x - z
double f(double x, double y, double z) {
        double r29877321 = x;
        double r29877322 = 3.0;
        double r29877323 = r29877321 * r29877322;
        double r29877324 = y;
        double r29877325 = r29877323 * r29877324;
        double r29877326 = z;
        double r29877327 = r29877325 - r29877326;
        return r29877327;
}

double f(double x, double y, double z) {
        double r29877328 = y;
        double r29877329 = 3.0;
        double r29877330 = r29877328 * r29877329;
        double r29877331 = x;
        double r29877332 = r29877330 * r29877331;
        double r29877333 = z;
        double r29877334 = r29877332 - r29877333;
        return r29877334;
}

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 \left(y \cdot 3\right) \cdot x - z\]

Reproduce

herbie shell --seed 2019174 +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))