Average Error: 0.3 → 0.2
Time: 18.4s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(y - x\right) \cdot \left(z \cdot 6\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(y - x\right) \cdot \left(z \cdot 6\right)
double f(double x, double y, double z) {
        double r475473 = x;
        double r475474 = y;
        double r475475 = r475474 - r475473;
        double r475476 = 6.0;
        double r475477 = r475475 * r475476;
        double r475478 = z;
        double r475479 = r475477 * r475478;
        double r475480 = r475473 + r475479;
        return r475480;
}

double f(double x, double y, double z) {
        double r475481 = x;
        double r475482 = y;
        double r475483 = r475482 - r475481;
        double r475484 = z;
        double r475485 = 6.0;
        double r475486 = r475484 * r475485;
        double r475487 = r475483 * r475486;
        double r475488 = r475481 + r475487;
        return r475488;
}

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

Derivation

  1. Initial program 0.3

    \[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot z\right)}\]
  4. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019326 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, E"
  :precision binary64

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

  (+ x (* (* (- y x) 6) z)))