Average Error: 0.3 → 0.2
Time: 10.0s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[\left(x - \left(z \cdot 6\right) \cdot x\right) - \left(-\left(y \cdot z\right) \cdot 6\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
\left(x - \left(z \cdot 6\right) \cdot x\right) - \left(-\left(y \cdot z\right) \cdot 6\right)
double f(double x, double y, double z) {
        double r647982 = x;
        double r647983 = y;
        double r647984 = r647983 - r647982;
        double r647985 = 6.0;
        double r647986 = r647984 * r647985;
        double r647987 = z;
        double r647988 = r647986 * r647987;
        double r647989 = r647982 + r647988;
        return r647989;
}

double f(double x, double y, double z) {
        double r647990 = x;
        double r647991 = z;
        double r647992 = 6.0;
        double r647993 = r647991 * r647992;
        double r647994 = r647993 * r647990;
        double r647995 = r647990 - r647994;
        double r647996 = y;
        double r647997 = r647996 * r647991;
        double r647998 = r647997 * r647992;
        double r647999 = -r647998;
        double r648000 = r647995 - r647999;
        return r648000;
}

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. Using strategy rm
  4. Applied sub-neg0.2

    \[\leadsto x - 6 \cdot \left(z \cdot \color{blue}{\left(x + \left(-y\right)\right)}\right)\]
  5. Applied distribute-rgt-in0.2

    \[\leadsto x - 6 \cdot \color{blue}{\left(x \cdot z + \left(-y\right) \cdot z\right)}\]
  6. Applied distribute-rgt-in0.2

    \[\leadsto x - \color{blue}{\left(\left(x \cdot z\right) \cdot 6 + \left(\left(-y\right) \cdot z\right) \cdot 6\right)}\]
  7. Applied associate--r+0.2

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

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

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

Reproduce

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