Average Error: 0.3 → 0.2
Time: 16.0s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
\[x + \left(z \cdot 6.0\right) \cdot \left(y - x\right)\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z
x + \left(z \cdot 6.0\right) \cdot \left(y - x\right)
double f(double x, double y, double z) {
        double r36159106 = x;
        double r36159107 = y;
        double r36159108 = r36159107 - r36159106;
        double r36159109 = 6.0;
        double r36159110 = r36159108 * r36159109;
        double r36159111 = z;
        double r36159112 = r36159110 * r36159111;
        double r36159113 = r36159106 + r36159112;
        return r36159113;
}

double f(double x, double y, double z) {
        double r36159114 = x;
        double r36159115 = z;
        double r36159116 = 6.0;
        double r36159117 = r36159115 * r36159116;
        double r36159118 = y;
        double r36159119 = r36159118 - r36159114;
        double r36159120 = r36159117 * r36159119;
        double r36159121 = r36159114 + r36159120;
        return r36159121;
}

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 inf 0.2

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

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

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

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