Average Error: 0.3 → 0.2
Time: 12.2s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z\]
\[x + \left(\left(y - x\right) \cdot z\right) \cdot 6.0\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot z
x + \left(\left(y - x\right) \cdot z\right) \cdot 6.0
double f(double x, double y, double z) {
        double r42507517 = x;
        double r42507518 = y;
        double r42507519 = r42507518 - r42507517;
        double r42507520 = 6.0;
        double r42507521 = r42507519 * r42507520;
        double r42507522 = z;
        double r42507523 = r42507521 * r42507522;
        double r42507524 = r42507517 + r42507523;
        return r42507524;
}

double f(double x, double y, double z) {
        double r42507525 = x;
        double r42507526 = y;
        double r42507527 = r42507526 - r42507525;
        double r42507528 = z;
        double r42507529 = r42507527 * r42507528;
        double r42507530 = 6.0;
        double r42507531 = r42507529 * r42507530;
        double r42507532 = r42507525 + r42507531;
        return r42507532;
}

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}{6.0 \cdot \left(z \cdot \left(y - x\right)\right)}\]
  4. Final simplification0.2

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

Reproduce

herbie shell --seed 2019165 
(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)))