Average Error: 0.2 → 0.1
Time: 40.5s
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 r36236201 = x;
        double r36236202 = 3.0;
        double r36236203 = r36236201 * r36236202;
        double r36236204 = y;
        double r36236205 = r36236203 * r36236204;
        double r36236206 = z;
        double r36236207 = r36236205 - r36236206;
        return r36236207;
}

double f(double x, double y, double z) {
        double r36236208 = y;
        double r36236209 = 3.0;
        double r36236210 = r36236208 * r36236209;
        double r36236211 = x;
        double r36236212 = r36236210 * r36236211;
        double r36236213 = z;
        double r36236214 = r36236212 - r36236213;
        return r36236214;
}

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))