Average Error: 0.3 → 0.2
Time: 12.7s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot z\]
\[x + \left(\left(y - x\right) \cdot z\right) \cdot 6\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot z
x + \left(\left(y - x\right) \cdot z\right) \cdot 6
double f(double x, double y, double z) {
        double r41048116 = x;
        double r41048117 = y;
        double r41048118 = r41048117 - r41048116;
        double r41048119 = 6.0;
        double r41048120 = r41048118 * r41048119;
        double r41048121 = z;
        double r41048122 = r41048120 * r41048121;
        double r41048123 = r41048116 + r41048122;
        return r41048123;
}

double f(double x, double y, double z) {
        double r41048124 = x;
        double r41048125 = y;
        double r41048126 = r41048125 - r41048124;
        double r41048127 = z;
        double r41048128 = r41048126 * r41048127;
        double r41048129 = 6.0;
        double r41048130 = r41048128 * r41048129;
        double r41048131 = r41048124 + r41048130;
        return r41048131;
}

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(\left(y - x\right) \cdot z\right) \cdot 6\]

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)))