Average Error: 3.4 → 0.3
Time: 13.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;1 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 2.490712852399317309173441658364335473301 \cdot 10^{162}:\\ \;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z = -\infty:\\
\;\;\;\;1 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\

\mathbf{elif}\;y \cdot z \le 2.490712852399317309173441658364335473301 \cdot 10^{162}:\\
\;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r10061836 = x;
        double r10061837 = 1.0;
        double r10061838 = y;
        double r10061839 = z;
        double r10061840 = r10061838 * r10061839;
        double r10061841 = r10061837 - r10061840;
        double r10061842 = r10061836 * r10061841;
        return r10061842;
}

double f(double x, double y, double z) {
        double r10061843 = y;
        double r10061844 = z;
        double r10061845 = r10061843 * r10061844;
        double r10061846 = -inf.0;
        bool r10061847 = r10061845 <= r10061846;
        double r10061848 = 1.0;
        double r10061849 = x;
        double r10061850 = r10061848 * r10061849;
        double r10061851 = -r10061849;
        double r10061852 = r10061851 * r10061844;
        double r10061853 = r10061852 * r10061843;
        double r10061854 = r10061850 + r10061853;
        double r10061855 = 2.4907128523993173e+162;
        bool r10061856 = r10061845 <= r10061855;
        double r10061857 = r10061851 * r10061845;
        double r10061858 = r10061857 + r10061850;
        double r10061859 = r10061856 ? r10061858 : r10061854;
        double r10061860 = r10061847 ? r10061854 : r10061859;
        return r10061860;
}

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 2.4907128523993173e+162 < (* y z)

    1. Initial program 31.1

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot x\]
    7. Applied associate-*l*1.9

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

    if -inf.0 < (* y z) < 2.4907128523993173e+162

    1. Initial program 0.1

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

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

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

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

Reproduce

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