Average Error: 3.4 → 0.1
Time: 1.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty \lor \neg \left(y \cdot z \le 1.20575771869087778 \cdot 10^{270}\right):\\ \;\;\;\;\left(x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\right) + x \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z = -\infty \lor \neg \left(y \cdot z \le 1.20575771869087778 \cdot 10^{270}\right):\\
\;\;\;\;\left(x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\right) + x \cdot 0\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\

\end{array}
double f(double x, double y, double z) {
        double r230625 = x;
        double r230626 = 1.0;
        double r230627 = y;
        double r230628 = z;
        double r230629 = r230627 * r230628;
        double r230630 = r230626 - r230629;
        double r230631 = r230625 * r230630;
        return r230631;
}

double f(double x, double y, double z) {
        double r230632 = y;
        double r230633 = z;
        double r230634 = r230632 * r230633;
        double r230635 = -inf.0;
        bool r230636 = r230634 <= r230635;
        double r230637 = 1.2057577186908778e+270;
        bool r230638 = r230634 <= r230637;
        double r230639 = !r230638;
        bool r230640 = r230636 || r230639;
        double r230641 = x;
        double r230642 = 1.0;
        double r230643 = r230641 * r230642;
        double r230644 = -r230632;
        double r230645 = r230641 * r230644;
        double r230646 = r230645 * r230633;
        double r230647 = r230643 + r230646;
        double r230648 = 0.0;
        double r230649 = r230641 * r230648;
        double r230650 = r230647 + r230649;
        double r230651 = -r230634;
        double r230652 = r230641 * r230651;
        double r230653 = r230643 + r230652;
        double r230654 = -r230633;
        double r230655 = r230633 * r230632;
        double r230656 = fma(r230654, r230632, r230655);
        double r230657 = r230641 * r230656;
        double r230658 = r230653 + r230657;
        double r230659 = r230640 ? r230650 : r230658;
        return r230659;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Split input into 2 regimes
  2. if (* y z) < -inf.0 or 1.2057577186908778e+270 < (* y z)

    1. Initial program 54.3

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt54.3

      \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - y \cdot z\right)\]
    4. Applied prod-diff54.3

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + \mathsf{fma}\left(-z, y, z \cdot y\right)\right)}\]
    5. Applied distribute-lft-in54.3

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)}\]
    6. Simplified54.3

      \[\leadsto \color{blue}{x \cdot \left(1 - y \cdot z\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
    7. Using strategy rm
    8. Applied sub-neg54.3

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
    9. Applied distribute-lft-in54.3

      \[\leadsto \color{blue}{\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
    10. Taylor expanded around 0 54.3

      \[\leadsto \left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \color{blue}{0}\]
    11. Using strategy rm
    12. Applied distribute-lft-neg-in54.3

      \[\leadsto \left(x \cdot 1 + x \cdot \color{blue}{\left(\left(-y\right) \cdot z\right)}\right) + x \cdot 0\]
    13. Applied associate-*r*0.3

      \[\leadsto \left(x \cdot 1 + \color{blue}{\left(x \cdot \left(-y\right)\right) \cdot z}\right) + x \cdot 0\]

    if -inf.0 < (* y z) < 1.2057577186908778e+270

    1. Initial program 0.1

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.1

      \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - y \cdot z\right)\]
    4. Applied prod-diff0.1

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + \mathsf{fma}\left(-z, y, z \cdot y\right)\right)}\]
    5. Applied distribute-lft-in0.1

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)}\]
    6. Simplified0.1

      \[\leadsto \color{blue}{x \cdot \left(1 - y \cdot z\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
    7. Using strategy rm
    8. Applied sub-neg0.1

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
    9. Applied distribute-lft-in0.1

      \[\leadsto \color{blue}{\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right)} + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z = -\infty \lor \neg \left(y \cdot z \le 1.20575771869087778 \cdot 10^{270}\right):\\ \;\;\;\;\left(x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\right) + x \cdot 0\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 1 + x \cdot \left(-y \cdot z\right)\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020065 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))