Average Error: 0.1 → 0.1
Time: 18.9s
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 r1031060 = x;
        double r1031061 = 3.0;
        double r1031062 = r1031060 * r1031061;
        double r1031063 = y;
        double r1031064 = r1031062 * r1031063;
        double r1031065 = z;
        double r1031066 = r1031064 - r1031065;
        return r1031066;
}

double f(double x, double y, double z) {
        double r1031067 = 3.0;
        double r1031068 = x;
        double r1031069 = y;
        double r1031070 = r1031068 * r1031069;
        double r1031071 = r1031067 * r1031070;
        double r1031072 = z;
        double r1031073 = r1031071 - r1031072;
        return r1031073;
}

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 
(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))