Average Error: 0.1 → 0.1
Time: 23.4s
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 r803815 = x;
        double r803816 = 3.0;
        double r803817 = r803815 * r803816;
        double r803818 = y;
        double r803819 = r803817 * r803818;
        double r803820 = z;
        double r803821 = r803819 - r803820;
        return r803821;
}

double f(double x, double y, double z) {
        double r803822 = 3.0;
        double r803823 = x;
        double r803824 = y;
        double r803825 = r803823 * r803824;
        double r803826 = r803822 * r803825;
        double r803827 = z;
        double r803828 = r803826 - r803827;
        return r803828;
}

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. Simplified0.1

    \[\leadsto x \cdot \color{blue}{\left(y \cdot 3\right)} - z\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.1

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

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

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

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

Reproduce

herbie shell --seed 2020042 +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))