Average Error: 0.1 → 0.1
Time: 2.5s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[x \cdot \left(3 \cdot y\right) - z\]
\left(x \cdot 3\right) \cdot y - z
x \cdot \left(3 \cdot y\right) - z
double f(double x, double y, double z) {
        double r734234 = x;
        double r734235 = 3.0;
        double r734236 = r734234 * r734235;
        double r734237 = y;
        double r734238 = r734236 * r734237;
        double r734239 = z;
        double r734240 = r734238 - r734239;
        return r734240;
}

double f(double x, double y, double z) {
        double r734241 = x;
        double r734242 = 3.0;
        double r734243 = y;
        double r734244 = r734242 * r734243;
        double r734245 = r734241 * r734244;
        double r734246 = z;
        double r734247 = r734245 - r734246;
        return r734247;
}

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.1
Target0.1
Herbie0.1
\[x \cdot \left(3 \cdot y\right) - z\]

Derivation

  1. Initial program 0.1

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

Reproduce

herbie shell --seed 2020089 +o rules:numerics
(FPCore (x y z)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, B"
  :precision binary64

  :herbie-target
  (- (* x (* 3 y)) z)

  (- (* (* x 3) y) z))