Average Error: 0.3 → 0.2
Time: 11.0s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x - \left(\left(x - y\right) \cdot z\right) \cdot 6\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x - \left(\left(x - y\right) \cdot z\right) \cdot 6
double f(double x, double y, double z) {
        double r557232 = x;
        double r557233 = y;
        double r557234 = r557233 - r557232;
        double r557235 = 6.0;
        double r557236 = r557234 * r557235;
        double r557237 = z;
        double r557238 = r557236 * r557237;
        double r557239 = r557232 + r557238;
        return r557239;
}

double f(double x, double y, double z) {
        double r557240 = x;
        double r557241 = y;
        double r557242 = r557240 - r557241;
        double r557243 = z;
        double r557244 = r557242 * r557243;
        double r557245 = 6.0;
        double r557246 = r557244 * r557245;
        double r557247 = r557240 - r557246;
        return r557247;
}

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. Simplified0.2

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

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

Reproduce

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