Average Error: 0.3 → 0.2
Time: 18.9s
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 r571775 = x;
        double r571776 = y;
        double r571777 = r571776 - r571775;
        double r571778 = 6.0;
        double r571779 = r571777 * r571778;
        double r571780 = z;
        double r571781 = r571779 * r571780;
        double r571782 = r571775 + r571781;
        return r571782;
}

double f(double x, double y, double z) {
        double r571783 = x;
        double r571784 = y;
        double r571785 = r571784 - r571783;
        double r571786 = z;
        double r571787 = 6.0;
        double r571788 = r571786 * r571787;
        double r571789 = r571785 * r571788;
        double r571790 = r571783 + r571789;
        return r571790;
}

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