Average Error: 0.3 → 0.2
Time: 15.3s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
\[\left(6.0 \cdot z\right) \cdot \left(y - x\right) + x\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z
\left(6.0 \cdot z\right) \cdot \left(y - x\right) + x
double f(double x, double y, double z) {
        double r37432281 = x;
        double r37432282 = y;
        double r37432283 = r37432282 - r37432281;
        double r37432284 = 6.0;
        double r37432285 = r37432283 * r37432284;
        double r37432286 = z;
        double r37432287 = r37432285 * r37432286;
        double r37432288 = r37432281 + r37432287;
        return r37432288;
}

double f(double x, double y, double z) {
        double r37432289 = 6.0;
        double r37432290 = z;
        double r37432291 = r37432289 * r37432290;
        double r37432292 = y;
        double r37432293 = x;
        double r37432294 = r37432292 - r37432293;
        double r37432295 = r37432291 * r37432294;
        double r37432296 = r37432295 + r37432293;
        return r37432296;
}

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.0 \cdot z\right) \cdot \left(x - y\right)\]

Derivation

  1. Initial program 0.3

    \[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
  2. Taylor expanded around 0 0.2

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

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

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

Reproduce

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

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

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