Average Error: 0.2 → 0.1
Time: 13.8s
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 r36483437 = x;
        double r36483438 = 3.0;
        double r36483439 = r36483437 * r36483438;
        double r36483440 = y;
        double r36483441 = r36483439 * r36483440;
        double r36483442 = z;
        double r36483443 = r36483441 - r36483442;
        return r36483443;
}

double f(double x, double y, double z) {
        double r36483444 = y;
        double r36483445 = x;
        double r36483446 = r36483444 * r36483445;
        double r36483447 = 3.0;
        double r36483448 = r36483446 * r36483447;
        double r36483449 = z;
        double r36483450 = r36483448 - r36483449;
        return r36483450;
}

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