Average Error: 0.2 → 0.1
Time: 14.1s
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 r31353371 = x;
        double r31353372 = 3.0;
        double r31353373 = r31353371 * r31353372;
        double r31353374 = y;
        double r31353375 = r31353373 * r31353374;
        double r31353376 = z;
        double r31353377 = r31353375 - r31353376;
        return r31353377;
}

double f(double x, double y, double z) {
        double r31353378 = y;
        double r31353379 = x;
        double r31353380 = r31353378 * r31353379;
        double r31353381 = 3.0;
        double r31353382 = r31353380 * r31353381;
        double r31353383 = z;
        double r31353384 = r31353382 - r31353383;
        return r31353384;
}

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

Reproduce

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