Average Error: 0.4 → 0.2
Time: 15.3s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)\]
\[\left(-\left(y - x\right) \cdot 6.0\right) \cdot z + \left(4.0 \cdot y - 3.0 \cdot x\right)\]
x + \left(\left(y - x\right) \cdot 6.0\right) \cdot \left(\frac{2.0}{3.0} - z\right)
\left(-\left(y - x\right) \cdot 6.0\right) \cdot z + \left(4.0 \cdot y - 3.0 \cdot x\right)
double f(double x, double y, double z) {
        double r15616415 = x;
        double r15616416 = y;
        double r15616417 = r15616416 - r15616415;
        double r15616418 = 6.0;
        double r15616419 = r15616417 * r15616418;
        double r15616420 = 2.0;
        double r15616421 = 3.0;
        double r15616422 = r15616420 / r15616421;
        double r15616423 = z;
        double r15616424 = r15616422 - r15616423;
        double r15616425 = r15616419 * r15616424;
        double r15616426 = r15616415 + r15616425;
        return r15616426;
}

double f(double x, double y, double z) {
        double r15616427 = y;
        double r15616428 = x;
        double r15616429 = r15616427 - r15616428;
        double r15616430 = 6.0;
        double r15616431 = r15616429 * r15616430;
        double r15616432 = -r15616431;
        double r15616433 = z;
        double r15616434 = r15616432 * r15616433;
        double r15616435 = 4.0;
        double r15616436 = r15616435 * r15616427;
        double r15616437 = 3.0;
        double r15616438 = r15616437 * r15616428;
        double r15616439 = r15616436 - r15616438;
        double r15616440 = r15616434 + r15616439;
        return r15616440;
}

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-rgt-in0.4

    \[\leadsto x + \color{blue}{\left(\frac{2.0}{3.0} \cdot \left(\left(y - x\right) \cdot 6.0\right) + \left(-z\right) \cdot \left(\left(y - x\right) \cdot 6.0\right)\right)}\]
  5. Applied associate-+r+0.4

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

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

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

Reproduce

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