Average Error: 3.4 → 0.2
Time: 11.4s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.316657533313902342261040936204101994876 \cdot 10^{216} \lor \neg \left(y \cdot z \le 4.106418830119920176371277439794922661684 \cdot 10^{205}\right):\\ \;\;\;\;x \cdot 1 + \left(-z \cdot \left(x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\mathsf{fma}\left(y, -z, {\left(\sqrt[3]{1}\right)}^{3}\right) + y \cdot \left(z + \left(-z\right)\right)\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -2.316657533313902342261040936204101994876 \cdot 10^{216} \lor \neg \left(y \cdot z \le 4.106418830119920176371277439794922661684 \cdot 10^{205}\right):\\
\;\;\;\;x \cdot 1 + \left(-z \cdot \left(x \cdot y\right)\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r234664 = x;
        double r234665 = 1.0;
        double r234666 = y;
        double r234667 = z;
        double r234668 = r234666 * r234667;
        double r234669 = r234665 - r234668;
        double r234670 = r234664 * r234669;
        return r234670;
}

double f(double x, double y, double z) {
        double r234671 = y;
        double r234672 = z;
        double r234673 = r234671 * r234672;
        double r234674 = -2.3166575333139023e+216;
        bool r234675 = r234673 <= r234674;
        double r234676 = 4.10641883011992e+205;
        bool r234677 = r234673 <= r234676;
        double r234678 = !r234677;
        bool r234679 = r234675 || r234678;
        double r234680 = x;
        double r234681 = 1.0;
        double r234682 = r234680 * r234681;
        double r234683 = r234680 * r234671;
        double r234684 = r234672 * r234683;
        double r234685 = -r234684;
        double r234686 = r234682 + r234685;
        double r234687 = -r234672;
        double r234688 = cbrt(r234681);
        double r234689 = 3.0;
        double r234690 = pow(r234688, r234689);
        double r234691 = fma(r234671, r234687, r234690);
        double r234692 = r234672 + r234687;
        double r234693 = r234671 * r234692;
        double r234694 = r234691 + r234693;
        double r234695 = r234680 * r234694;
        double r234696 = r234679 ? r234686 : r234695;
        return r234696;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Derivation

  1. Split input into 2 regimes
  2. if (* y z) < -2.3166575333139023e+216 or 4.10641883011992e+205 < (* y z)

    1. Initial program 28.7

      \[x \cdot \left(1 - y \cdot z\right)\]
    2. Using strategy rm
    3. Applied sub-neg28.7

      \[\leadsto x \cdot \color{blue}{\left(1 + \left(-y \cdot z\right)\right)}\]
    4. Applied distribute-rgt-in28.7

      \[\leadsto \color{blue}{1 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Simplified28.7

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

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

    if -2.3166575333139023e+216 < (* y z) < 4.10641883011992e+205

    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. Simplified0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.316657533313902342261040936204101994876 \cdot 10^{216} \lor \neg \left(y \cdot z \le 4.106418830119920176371277439794922661684 \cdot 10^{205}\right):\\ \;\;\;\;x \cdot 1 + \left(-z \cdot \left(x \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\mathsf{fma}\left(y, -z, {\left(\sqrt[3]{1}\right)}^{3}\right) + y \cdot \left(z + \left(-z\right)\right)\right)\\ \end{array}\]

Reproduce

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