Average Error: 0.2 → 0.2
Time: 2.1s
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 r756520 = x;
        double r756521 = 3.0;
        double r756522 = r756520 * r756521;
        double r756523 = y;
        double r756524 = r756522 * r756523;
        double r756525 = z;
        double r756526 = r756524 - r756525;
        return r756526;
}

double f(double x, double y, double z) {
        double r756527 = x;
        double r756528 = 3.0;
        double r756529 = y;
        double r756530 = r756528 * r756529;
        double r756531 = r756527 * r756530;
        double r756532 = z;
        double r756533 = r756531 - r756532;
        return r756533;
}

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.2
Target0.2
Herbie0.2
\[x \cdot \left(3 \cdot y\right) - z\]

Derivation

  1. Initial program 0.2

    \[\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 2020020 +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))