Average Error: 0.4 → 0.2
Time: 2.9s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\]
\[\left(4 \cdot y - \left(6 \cdot \left(z \cdot y\right) + 3 \cdot x\right)\right) + \left(-x\right) \cdot \left(6 \cdot \left(-z\right)\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\left(4 \cdot y - \left(6 \cdot \left(z \cdot y\right) + 3 \cdot x\right)\right) + \left(-x\right) \cdot \left(6 \cdot \left(-z\right)\right)
double f(double x, double y, double z) {
        double r296047 = x;
        double r296048 = y;
        double r296049 = r296048 - r296047;
        double r296050 = 6.0;
        double r296051 = r296049 * r296050;
        double r296052 = 2.0;
        double r296053 = 3.0;
        double r296054 = r296052 / r296053;
        double r296055 = z;
        double r296056 = r296054 - r296055;
        double r296057 = r296051 * r296056;
        double r296058 = r296047 + r296057;
        return r296058;
}

double f(double x, double y, double z) {
        double r296059 = 4.0;
        double r296060 = y;
        double r296061 = r296059 * r296060;
        double r296062 = 6.0;
        double r296063 = z;
        double r296064 = r296063 * r296060;
        double r296065 = r296062 * r296064;
        double r296066 = 3.0;
        double r296067 = x;
        double r296068 = r296066 * r296067;
        double r296069 = r296065 + r296068;
        double r296070 = r296061 - r296069;
        double r296071 = -r296067;
        double r296072 = -r296063;
        double r296073 = r296062 * r296072;
        double r296074 = r296071 * r296073;
        double r296075 = r296070 + r296074;
        return r296075;
}

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\right) \cdot \left(\frac{2}{3} - z\right)\]
  2. Using strategy rm
  3. Applied associate-*l*0.2

    \[\leadsto x + \color{blue}{\left(y - x\right) \cdot \left(6 \cdot \left(\frac{2}{3} - z\right)\right)}\]
  4. Using strategy rm
  5. Applied sub-neg0.2

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

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

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

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

    \[\leadsto \color{blue}{\left(x + \left(\frac{2}{3} \cdot 6\right) \cdot \left(y - x\right)\right)} + \left(6 \cdot \left(-z\right)\right) \cdot \left(y - x\right)\]
  10. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{\left(4 \cdot y - 3 \cdot x\right)} + \left(6 \cdot \left(-z\right)\right) \cdot \left(y - x\right)\]
  11. Using strategy rm
  12. Applied sub-neg0.2

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

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

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

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

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

Reproduce

herbie shell --seed 2020060 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
  :precision binary64
  (+ x (* (* (- y x) 6) (- (/ 2 3) z))))