Average Error: 3.0 → 0.1
Time: 13.5s
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 r12593045 = x;
        double r12593046 = 1.0;
        double r12593047 = y;
        double r12593048 = z;
        double r12593049 = r12593047 * r12593048;
        double r12593050 = r12593046 - r12593049;
        double r12593051 = r12593045 * r12593050;
        return r12593051;
}

double f(double x, double y, double z) {
        double r12593052 = y;
        double r12593053 = z;
        double r12593054 = r12593052 * r12593053;
        double r12593055 = -inf.0;
        bool r12593056 = r12593054 <= r12593055;
        double r12593057 = 1.0;
        double r12593058 = x;
        double r12593059 = r12593057 * r12593058;
        double r12593060 = r12593058 * r12593053;
        double r12593061 = r12593052 * r12593060;
        double r12593062 = r12593059 - r12593061;
        double r12593063 = 3.6070881227494406e+301;
        bool r12593064 = r12593054 <= r12593063;
        double r12593065 = r12593058 * r12593054;
        double r12593066 = r12593059 - r12593065;
        double r12593067 = r12593064 ? r12593066 : r12593062;
        double r12593068 = r12593056 ? r12593062 : r12593067;
        return r12593068;
}

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))))