Average Error: 0.4 → 0.2
Time: 14.9s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\]
\[\left(4 \cdot y - 3 \cdot x\right) + 6 \cdot \left(\left(x - y\right) \cdot z\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\left(4 \cdot y - 3 \cdot x\right) + 6 \cdot \left(\left(x - y\right) \cdot z\right)
double f(double x, double y, double z) {
        double r14027028 = x;
        double r14027029 = y;
        double r14027030 = r14027029 - r14027028;
        double r14027031 = 6.0;
        double r14027032 = r14027030 * r14027031;
        double r14027033 = 2.0;
        double r14027034 = 3.0;
        double r14027035 = r14027033 / r14027034;
        double r14027036 = z;
        double r14027037 = r14027035 - r14027036;
        double r14027038 = r14027032 * r14027037;
        double r14027039 = r14027028 + r14027038;
        return r14027039;
}

double f(double x, double y, double z) {
        double r14027040 = 4.0;
        double r14027041 = y;
        double r14027042 = r14027040 * r14027041;
        double r14027043 = 3.0;
        double r14027044 = x;
        double r14027045 = r14027043 * r14027044;
        double r14027046 = r14027042 - r14027045;
        double r14027047 = 6.0;
        double r14027048 = r14027044 - r14027041;
        double r14027049 = z;
        double r14027050 = r14027048 * r14027049;
        double r14027051 = r14027047 * r14027050;
        double r14027052 = r14027046 + r14027051;
        return r14027052;
}

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 sub-neg0.4

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

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

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

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

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

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

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

Reproduce

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