Average Error: 3.0 → 0.1
Time: 11.9s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;y \cdot z \le 3.6070881227494406 \cdot 10^{+301}:\\ \;\;\;\;1.0 \cdot x - x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z = -\infty:\\
\;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\

\mathbf{elif}\;y \cdot z \le 3.6070881227494406 \cdot 10^{+301}:\\
\;\;\;\;1.0 \cdot x - x \cdot \left(y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\

\end{array}
double f(double x, double y, double z) {
        double r12826610 = x;
        double r12826611 = 1.0;
        double r12826612 = y;
        double r12826613 = z;
        double r12826614 = r12826612 * r12826613;
        double r12826615 = r12826611 - r12826614;
        double r12826616 = r12826610 * r12826615;
        return r12826616;
}

double f(double x, double y, double z) {
        double r12826617 = y;
        double r12826618 = z;
        double r12826619 = r12826617 * r12826618;
        double r12826620 = -inf.0;
        bool r12826621 = r12826619 <= r12826620;
        double r12826622 = 1.0;
        double r12826623 = x;
        double r12826624 = r12826622 * r12826623;
        double r12826625 = r12826623 * r12826618;
        double r12826626 = r12826617 * r12826625;
        double r12826627 = r12826624 - r12826626;
        double r12826628 = 3.6070881227494406e+301;
        bool r12826629 = r12826619 <= r12826628;
        double r12826630 = r12826623 * r12826619;
        double r12826631 = r12826624 - r12826630;
        double r12826632 = r12826629 ? r12826631 : r12826627;
        double r12826633 = r12826621 ? r12826627 : r12826632;
        return r12826633;
}

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. Split input into 2 regimes
  2. if (* y z) < -inf.0 or 3.6070881227494406e+301 < (* y z)

    1. Initial program 58.1

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

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

      \[\leadsto \color{blue}{1.0 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Using strategy rm
    6. Applied distribute-lft-neg-out58.1

      \[\leadsto 1.0 \cdot x + \color{blue}{\left(-\left(y \cdot z\right) \cdot x\right)}\]
    7. Applied unsub-neg58.1

      \[\leadsto \color{blue}{1.0 \cdot x - \left(y \cdot z\right) \cdot x}\]
    8. Using strategy rm
    9. Applied associate-*l*0.3

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

    if -inf.0 < (* y z) < 3.6070881227494406e+301

    1. Initial program 0.1

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

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

      \[\leadsto \color{blue}{1.0 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Using strategy rm
    6. Applied distribute-lft-neg-out0.1

      \[\leadsto 1.0 \cdot x + \color{blue}{\left(-\left(y \cdot z\right) \cdot x\right)}\]
    7. Applied unsub-neg0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\ \mathbf{elif}\;y \cdot z \le 3.6070881227494406 \cdot 10^{+301}:\\ \;\;\;\;1.0 \cdot x - x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x - y \cdot \left(x \cdot z\right)\\ \end{array}\]

Reproduce

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