Average Error: 0.4 → 0.2
Time: 20.9s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)\]
\[x + \left(4.0 - 6.0 \cdot z\right) \cdot \left(y - x\right)\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)
x + \left(4.0 - 6.0 \cdot z\right) \cdot \left(y - x\right)
double f(double x, double y, double z) {
        double r10781150 = x;
        double r10781151 = y;
        double r10781152 = r10781151 - r10781150;
        double r10781153 = 6.0;
        double r10781154 = r10781152 * r10781153;
        double r10781155 = 2.0;
        double r10781156 = 3.0;
        double r10781157 = r10781155 / r10781156;
        double r10781158 = z;
        double r10781159 = r10781157 - r10781158;
        double r10781160 = r10781154 * r10781159;
        double r10781161 = r10781150 + r10781160;
        return r10781161;
}

double f(double x, double y, double z) {
        double r10781162 = x;
        double r10781163 = 4.0;
        double r10781164 = 6.0;
        double r10781165 = z;
        double r10781166 = r10781164 * r10781165;
        double r10781167 = r10781163 - r10781166;
        double r10781168 = y;
        double r10781169 = r10781168 - r10781162;
        double r10781170 = r10781167 * r10781169;
        double r10781171 = r10781162 + r10781170;
        return r10781171;
}

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

Derivation

  1. Initial program 0.4

    \[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6.0 \cdot \left(\frac{2.0}{3.0} - z\right)\right)}\]
  4. Taylor expanded around 0 0.2

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
  (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))