Average Error: 0.2 → 0.1
Time: 11.4s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[3 \cdot \left(x \cdot y\right) - z\]
\left(x \cdot 3\right) \cdot y - z
3 \cdot \left(x \cdot y\right) - z
double f(double x, double y, double z) {
        double r513318 = x;
        double r513319 = 3.0;
        double r513320 = r513318 * r513319;
        double r513321 = y;
        double r513322 = r513320 * r513321;
        double r513323 = z;
        double r513324 = r513322 - r513323;
        return r513324;
}

double f(double x, double y, double z) {
        double r513325 = 3.0;
        double r513326 = x;
        double r513327 = y;
        double r513328 = r513326 * r513327;
        double r513329 = r513325 * r513328;
        double r513330 = z;
        double r513331 = r513329 - r513330;
        return r513331;
}

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.2
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. Taylor expanded around 0 0.1

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

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

Reproduce

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