Average Error: 0.3 → 0.2
Time: 15.4s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(z \cdot \left(y - x\right)\right) \cdot 6\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(z \cdot \left(y - x\right)\right) \cdot 6
double f(double x, double y, double z) {
        double r607250 = x;
        double r607251 = y;
        double r607252 = r607251 - r607250;
        double r607253 = 6.0;
        double r607254 = r607252 * r607253;
        double r607255 = z;
        double r607256 = r607254 * r607255;
        double r607257 = r607250 + r607256;
        return r607257;
}

double f(double x, double y, double z) {
        double r607258 = x;
        double r607259 = z;
        double r607260 = y;
        double r607261 = r607260 - r607258;
        double r607262 = r607259 * r607261;
        double r607263 = 6.0;
        double r607264 = r607262 * r607263;
        double r607265 = r607258 + r607264;
        return r607265;
}

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. Taylor expanded around inf 0.2

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

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

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

Reproduce

herbie shell --seed 2019212 +o rules:numerics
(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)))