Average Error: 0.2 → 0.1
Time: 8.4s
Precision: 64
\[\left(x \cdot 3\right) \cdot y - z\]
\[\left(3 \cdot y\right) \cdot x - z\]
\left(x \cdot 3\right) \cdot y - z
\left(3 \cdot y\right) \cdot x - z
double f(double x, double y, double z) {
        double r685820 = x;
        double r685821 = 3.0;
        double r685822 = r685820 * r685821;
        double r685823 = y;
        double r685824 = r685822 * r685823;
        double r685825 = z;
        double r685826 = r685824 - r685825;
        return r685826;
}

double f(double x, double y, double z) {
        double r685827 = 3.0;
        double r685828 = y;
        double r685829 = r685827 * r685828;
        double r685830 = x;
        double r685831 = r685829 * r685830;
        double r685832 = z;
        double r685833 = r685831 - r685832;
        return r685833;
}

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

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

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

Reproduce

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