Average Error: 0.2 → 0.1
Time: 7.1s
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 r612351 = x;
        double r612352 = 3.0;
        double r612353 = r612351 * r612352;
        double r612354 = y;
        double r612355 = r612353 * r612354;
        double r612356 = z;
        double r612357 = r612355 - r612356;
        return r612357;
}

double f(double x, double y, double z) {
        double r612358 = 3.0;
        double r612359 = y;
        double r612360 = r612358 * r612359;
        double r612361 = x;
        double r612362 = r612360 * r612361;
        double r612363 = z;
        double r612364 = r612362 - r612363;
        return r612364;
}

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