Average Error: 0.2 → 0.1
Time: 11.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 r54034020 = x;
        double r54034021 = 3.0;
        double r54034022 = r54034020 * r54034021;
        double r54034023 = y;
        double r54034024 = r54034022 * r54034023;
        double r54034025 = z;
        double r54034026 = r54034024 - r54034025;
        return r54034026;
}

double f(double x, double y, double z) {
        double r54034027 = x;
        double r54034028 = 3.0;
        double r54034029 = y;
        double r54034030 = r54034028 * r54034029;
        double r54034031 = r54034027 * r54034030;
        double r54034032 = z;
        double r54034033 = r54034031 - r54034032;
        return r54034033;
}

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.1
Herbie0.1
\[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.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 2019174 
(FPCore (x y z)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, B"

  :herbie-target
  (- (* x (* 3.0 y)) z)

  (- (* (* x 3.0) y) z))