Average Error: 0.4 → 0.2
Time: 13.7s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)\]
\[x + \left(\left(y - x\right) \cdot 4.0 + \left(z \cdot \left(x - y\right)\right) \cdot 6.0\right)\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)
x + \left(\left(y - x\right) \cdot 4.0 + \left(z \cdot \left(x - y\right)\right) \cdot 6.0\right)
double f(double x, double y, double z) {
        double r15730794 = x;
        double r15730795 = y;
        double r15730796 = r15730795 - r15730794;
        double r15730797 = 6.0;
        double r15730798 = r15730796 * r15730797;
        double r15730799 = 2.0;
        double r15730800 = 3.0;
        double r15730801 = r15730799 / r15730800;
        double r15730802 = z;
        double r15730803 = r15730801 - r15730802;
        double r15730804 = r15730798 * r15730803;
        double r15730805 = r15730794 + r15730804;
        return r15730805;
}

double f(double x, double y, double z) {
        double r15730806 = x;
        double r15730807 = y;
        double r15730808 = r15730807 - r15730806;
        double r15730809 = 4.0;
        double r15730810 = r15730808 * r15730809;
        double r15730811 = z;
        double r15730812 = r15730806 - r15730807;
        double r15730813 = r15730811 * r15730812;
        double r15730814 = 6.0;
        double r15730815 = r15730813 * r15730814;
        double r15730816 = r15730810 + r15730815;
        double r15730817 = r15730806 + r15730816;
        return r15730817;
}

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

Derivation

  1. Initial program 0.4

    \[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.4

    \[\leadsto x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \color{blue}{\left(\frac{2.0}{3.0} + \left(-z\right)\right)}\]
  4. Applied distribute-lft-in0.4

    \[\leadsto x + \color{blue}{\left(\left(\left(y - x\right) \cdot 6.0\right) \cdot \frac{2.0}{3.0} + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(-z\right)\right)}\]
  5. Taylor expanded around inf 0.4

    \[\leadsto x + \left(\left(\left(y - x\right) \cdot 6.0\right) \cdot \frac{2.0}{3.0} + \color{blue}{\left(6.0 \cdot \left(x \cdot z\right) - 6.0 \cdot \left(z \cdot y\right)\right)}\right)\]
  6. Simplified0.4

    \[\leadsto x + \left(\left(\left(y - x\right) \cdot 6.0\right) \cdot \frac{2.0}{3.0} + \color{blue}{\left(z \cdot \left(x - y\right)\right) \cdot 6.0}\right)\]
  7. Taylor expanded around 0 0.2

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

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

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

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
  (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))