Average Error: 0.1 → 0.1
Time: 13.7s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[3 \cdot \left(x \cdot y\right) - z\]
\left(x \cdot 3\right) \cdot y - z
3 \cdot \left(x \cdot y\right) - z
double f(double x, double y, double z) {
        double r644658 = x;
        double r644659 = 3.0;
        double r644660 = r644658 * r644659;
        double r644661 = y;
        double r644662 = r644660 * r644661;
        double r644663 = z;
        double r644664 = r644662 - r644663;
        return r644664;
}

double f(double x, double y, double z) {
        double r644665 = 3.0;
        double r644666 = x;
        double r644667 = y;
        double r644668 = r644666 * r644667;
        double r644669 = r644665 * r644668;
        double r644670 = z;
        double r644671 = r644669 - r644670;
        return r644671;
}

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. Using strategy rm
  5. Applied *-un-lft-identity0.1

    \[\leadsto \color{blue}{\left(1 \cdot x\right)} \cdot \left(3 \cdot y\right) - z\]
  6. Applied associate-*l*0.1

    \[\leadsto \color{blue}{1 \cdot \left(x \cdot \left(3 \cdot y\right)\right)} - z\]
  7. Simplified0.1

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

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

Reproduce

herbie shell --seed 2020045 
(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))