Average Error: 0.4 → 0.2
Time: 29.6s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\]
\[x + \left(\left(y - x\right) \cdot \left(6 \cdot \frac{2}{3}\right) + 6 \cdot \left(z \cdot \left(x - y\right)\right)\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
x + \left(\left(y - x\right) \cdot \left(6 \cdot \frac{2}{3}\right) + 6 \cdot \left(z \cdot \left(x - y\right)\right)\right)
double f(double x, double y, double z) {
        double r30783485 = x;
        double r30783486 = y;
        double r30783487 = r30783486 - r30783485;
        double r30783488 = 6.0;
        double r30783489 = r30783487 * r30783488;
        double r30783490 = 2.0;
        double r30783491 = 3.0;
        double r30783492 = r30783490 / r30783491;
        double r30783493 = z;
        double r30783494 = r30783492 - r30783493;
        double r30783495 = r30783489 * r30783494;
        double r30783496 = r30783485 + r30783495;
        return r30783496;
}

double f(double x, double y, double z) {
        double r30783497 = x;
        double r30783498 = y;
        double r30783499 = r30783498 - r30783497;
        double r30783500 = 6.0;
        double r30783501 = 2.0;
        double r30783502 = 3.0;
        double r30783503 = r30783501 / r30783502;
        double r30783504 = r30783500 * r30783503;
        double r30783505 = r30783499 * r30783504;
        double r30783506 = z;
        double r30783507 = r30783497 - r30783498;
        double r30783508 = r30783506 * r30783507;
        double r30783509 = r30783500 * r30783508;
        double r30783510 = r30783505 + r30783509;
        double r30783511 = r30783497 + r30783510;
        return r30783511;
}

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-lft-in0.2

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

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

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

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

Reproduce

herbie shell --seed 2019173 +o rules:numerics
(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))))