Average Error: 0.4 → 0.2
Time: 23.6s
Precision: 64
\[x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)\]
\[\mathsf{fma}\left(y - x, 6 \cdot \mathsf{fma}\left(\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}, \frac{2}{\sqrt[3]{3}}, -z\right), x\right)\]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\mathsf{fma}\left(y - x, 6 \cdot \mathsf{fma}\left(\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}, \frac{2}{\sqrt[3]{3}}, -z\right), x\right)
double f(double x, double y, double z) {
        double r172199 = x;
        double r172200 = y;
        double r172201 = r172200 - r172199;
        double r172202 = 6.0;
        double r172203 = r172201 * r172202;
        double r172204 = 2.0;
        double r172205 = 3.0;
        double r172206 = r172204 / r172205;
        double r172207 = z;
        double r172208 = r172206 - r172207;
        double r172209 = r172203 * r172208;
        double r172210 = r172199 + r172209;
        return r172210;
}

double f(double x, double y, double z) {
        double r172211 = y;
        double r172212 = x;
        double r172213 = r172211 - r172212;
        double r172214 = 6.0;
        double r172215 = 1.0;
        double r172216 = 3.0;
        double r172217 = cbrt(r172216);
        double r172218 = r172217 * r172217;
        double r172219 = r172215 / r172218;
        double r172220 = 2.0;
        double r172221 = r172220 / r172217;
        double r172222 = z;
        double r172223 = -r172222;
        double r172224 = fma(r172219, r172221, r172223);
        double r172225 = r172214 * r172224;
        double r172226 = fma(r172213, r172225, r172212);
        return r172226;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Initial program 0.4

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - x, 6 \cdot \left(\frac{2}{3} - z\right), x\right)}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.2

    \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \left(\frac{2}{\color{blue}{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}}} - z\right), x\right)\]
  5. Applied *-un-lft-identity0.2

    \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \left(\frac{\color{blue}{1 \cdot 2}}{\left(\sqrt[3]{3} \cdot \sqrt[3]{3}\right) \cdot \sqrt[3]{3}} - z\right), x\right)\]
  6. Applied times-frac0.2

    \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \left(\color{blue}{\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}} \cdot \frac{2}{\sqrt[3]{3}}} - z\right), x\right)\]
  7. Applied fma-neg0.2

    \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}, \frac{2}{\sqrt[3]{3}}, -z\right)}, x\right)\]
  8. Final simplification0.2

    \[\leadsto \mathsf{fma}\left(y - x, 6 \cdot \mathsf{fma}\left(\frac{1}{\sqrt[3]{3} \cdot \sqrt[3]{3}}, \frac{2}{\sqrt[3]{3}}, -z\right), x\right)\]

Reproduce

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