Average Error: 0.2 → 0.1
Time: 10.9s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[\left(y \cdot x\right) \cdot 3 - z\]
\left(x \cdot 3\right) \cdot y - z
\left(y \cdot x\right) \cdot 3 - z
double f(double x, double y, double z) {
        double r22121076 = x;
        double r22121077 = 3.0;
        double r22121078 = r22121076 * r22121077;
        double r22121079 = y;
        double r22121080 = r22121078 * r22121079;
        double r22121081 = z;
        double r22121082 = r22121080 - r22121081;
        return r22121082;
}

double f(double x, double y, double z) {
        double r22121083 = y;
        double r22121084 = x;
        double r22121085 = r22121083 * r22121084;
        double r22121086 = 3.0;
        double r22121087 = r22121085 * r22121086;
        double r22121088 = z;
        double r22121089 = r22121087 - r22121088;
        return r22121089;
}

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

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

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

Reproduce

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