Average Error: 0.1 → 0.1
Time: 9.3s
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 r758949 = x;
        double r758950 = 3.0;
        double r758951 = r758949 * r758950;
        double r758952 = y;
        double r758953 = r758951 * r758952;
        double r758954 = z;
        double r758955 = r758953 - r758954;
        return r758955;
}

double f(double x, double y, double z) {
        double r758956 = x;
        double r758957 = 3.0;
        double r758958 = y;
        double r758959 = r758957 * r758958;
        double r758960 = r758956 * r758959;
        double r758961 = z;
        double r758962 = r758960 - r758961;
        return r758962;
}

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