Average Error: 0.2 → 0.1
Time: 10.4s
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 r35023315 = x;
        double r35023316 = 3.0;
        double r35023317 = r35023315 * r35023316;
        double r35023318 = y;
        double r35023319 = r35023317 * r35023318;
        double r35023320 = z;
        double r35023321 = r35023319 - r35023320;
        return r35023321;
}

double f(double x, double y, double z) {
        double r35023322 = y;
        double r35023323 = 3.0;
        double r35023324 = r35023322 * r35023323;
        double r35023325 = x;
        double r35023326 = r35023324 * r35023325;
        double r35023327 = z;
        double r35023328 = r35023326 - r35023327;
        return r35023328;
}

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