Average Error: 0.2 → 0.2
Time: 6.7s
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 r551788 = x;
        double r551789 = 3.0;
        double r551790 = r551788 * r551789;
        double r551791 = y;
        double r551792 = r551790 * r551791;
        double r551793 = z;
        double r551794 = r551792 - r551793;
        return r551794;
}

double f(double x, double y, double z) {
        double r551795 = x;
        double r551796 = 3.0;
        double r551797 = y;
        double r551798 = r551796 * r551797;
        double r551799 = r551795 * r551798;
        double r551800 = z;
        double r551801 = r551799 - r551800;
        return r551801;
}

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

Derivation

  1. Initial program 0.2

    \[\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 2019294 
(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))