Average Error: 0.1 → 0.1
Time: 19.1s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[\left(x \cdot y\right) \cdot 3 - z\]
\left(x \cdot 3\right) \cdot y - z
\left(x \cdot y\right) \cdot 3 - z
double f(double x, double y, double z) {
        double r841114 = x;
        double r841115 = 3.0;
        double r841116 = r841114 * r841115;
        double r841117 = y;
        double r841118 = r841116 * r841117;
        double r841119 = z;
        double r841120 = r841118 - r841119;
        return r841120;
}

double f(double x, double y, double z) {
        double r841121 = x;
        double r841122 = y;
        double r841123 = r841121 * r841122;
        double r841124 = 3.0;
        double r841125 = r841123 * r841124;
        double r841126 = z;
        double r841127 = r841125 - r841126;
        return r841127;
}

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

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

    \[\leadsto x \cdot \left(\color{blue}{{y}^{1}} \cdot {3}^{1}\right) - z\]
  8. Applied pow-prod-down0.1

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

    \[\leadsto \color{blue}{{x}^{1}} \cdot {\left(y \cdot 3\right)}^{1} - z\]
  10. Applied pow-prod-down0.1

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

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

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

Reproduce

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