Average Error: 0.1 → 0.1
Time: 2.0s
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 r747138 = x;
        double r747139 = 3.0;
        double r747140 = r747138 * r747139;
        double r747141 = y;
        double r747142 = r747140 * r747141;
        double r747143 = z;
        double r747144 = r747142 - r747143;
        return r747144;
}

double f(double x, double y, double z) {
        double r747145 = x;
        double r747146 = 3.0;
        double r747147 = y;
        double r747148 = r747146 * r747147;
        double r747149 = r747145 * r747148;
        double r747150 = z;
        double r747151 = r747149 - r747150;
        return r747151;
}

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