Average Error: 0.1 → 0.2
Time: 1.8s
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 r676666 = x;
        double r676667 = 3.0;
        double r676668 = r676666 * r676667;
        double r676669 = y;
        double r676670 = r676668 * r676669;
        double r676671 = z;
        double r676672 = r676670 - r676671;
        return r676672;
}

double f(double x, double y, double z) {
        double r676673 = x;
        double r676674 = 3.0;
        double r676675 = y;
        double r676676 = r676674 * r676675;
        double r676677 = r676673 * r676676;
        double r676678 = z;
        double r676679 = r676677 - r676678;
        return r676679;
}

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.2
Herbie0.2
\[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.2

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

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

Reproduce

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