Average Error: 3.6 → 0.4
Time: 11.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 2.246543093657474555894251671932244732299 \cdot 10^{110}:\\ \;\;\;\;\left(\left(-z\right) \cdot y\right) \cdot x + x \cdot 1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z = -\infty:\\
\;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r10705138 = x;
        double r10705139 = 1.0;
        double r10705140 = y;
        double r10705141 = z;
        double r10705142 = r10705140 * r10705141;
        double r10705143 = r10705139 - r10705142;
        double r10705144 = r10705138 * r10705143;
        return r10705144;
}

double f(double x, double y, double z) {
        double r10705145 = y;
        double r10705146 = z;
        double r10705147 = r10705145 * r10705146;
        double r10705148 = -inf.0;
        bool r10705149 = r10705147 <= r10705148;
        double r10705150 = x;
        double r10705151 = 1.0;
        double r10705152 = r10705150 * r10705151;
        double r10705153 = r10705150 * r10705145;
        double r10705154 = -r10705146;
        double r10705155 = r10705153 * r10705154;
        double r10705156 = r10705152 + r10705155;
        double r10705157 = 2.2465430936574746e+110;
        bool r10705158 = r10705147 <= r10705157;
        double r10705159 = r10705154 * r10705145;
        double r10705160 = r10705159 * r10705150;
        double r10705161 = r10705160 + r10705152;
        double r10705162 = r10705158 ? r10705161 : r10705156;
        double r10705163 = r10705149 ? r10705156 : r10705162;
        return r10705163;
}

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.2465430936574746e+110 < (* y z)

    1. Initial program 24.9

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

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

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

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

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

    if -inf.0 < (* y z) < 2.2465430936574746e+110

    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-lft-in0.1

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

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

Reproduce

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