Average Error: 3.5 → 3.1
Time: 2.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.671253073044597861783345883626749758604 \cdot 10^{138} \lor \neg \left(y \le 1.960803050623658027373990885927505399753 \cdot 10^{71} \lor \neg \left(y \le 6.198127841043233411679773067859289148308 \cdot 10^{226}\right)\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \le -3.671253073044597861783345883626749758604 \cdot 10^{138} \lor \neg \left(y \le 1.960803050623658027373990885927505399753 \cdot 10^{71} \lor \neg \left(y \le 6.198127841043233411679773067859289148308 \cdot 10^{226}\right)\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r236216 = x;
        double r236217 = 1.0;
        double r236218 = y;
        double r236219 = z;
        double r236220 = r236218 * r236219;
        double r236221 = r236217 - r236220;
        double r236222 = r236216 * r236221;
        return r236222;
}

double f(double x, double y, double z) {
        double r236223 = y;
        double r236224 = -3.671253073044598e+138;
        bool r236225 = r236223 <= r236224;
        double r236226 = 1.960803050623658e+71;
        bool r236227 = r236223 <= r236226;
        double r236228 = 6.198127841043233e+226;
        bool r236229 = r236223 <= r236228;
        double r236230 = !r236229;
        bool r236231 = r236227 || r236230;
        double r236232 = !r236231;
        bool r236233 = r236225 || r236232;
        double r236234 = x;
        double r236235 = 1.0;
        double r236236 = r236234 * r236235;
        double r236237 = r236234 * r236223;
        double r236238 = z;
        double r236239 = -r236238;
        double r236240 = r236237 * r236239;
        double r236241 = r236236 + r236240;
        double r236242 = r236223 * r236238;
        double r236243 = -r236242;
        double r236244 = r236234 * r236243;
        double r236245 = r236236 + r236244;
        double r236246 = r236233 ? r236241 : r236245;
        return r236246;
}

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 < -3.671253073044598e+138 or 1.960803050623658e+71 < y < 6.198127841043233e+226

    1. Initial program 10.2

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

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

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

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

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

    if -3.671253073044598e+138 < y < 1.960803050623658e+71 or 6.198127841043233e+226 < y

    1. Initial program 1.6

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -3.671253073044597861783345883626749758604 \cdot 10^{138} \lor \neg \left(y \le 1.960803050623658027373990885927505399753 \cdot 10^{71} \lor \neg \left(y \le 6.198127841043233411679773067859289148308 \cdot 10^{226}\right)\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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