Average Error: 0.1 → 0.2
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 r776805 = x;
        double r776806 = 3.0;
        double r776807 = r776805 * r776806;
        double r776808 = y;
        double r776809 = r776807 * r776808;
        double r776810 = z;
        double r776811 = r776809 - r776810;
        return r776811;
}

double f(double x, double y, double z) {
        double r776812 = x;
        double r776813 = 3.0;
        double r776814 = y;
        double r776815 = r776813 * r776814;
        double r776816 = r776812 * r776815;
        double r776817 = z;
        double r776818 = r776816 - r776817;
        return r776818;
}

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