Average Error: 3.5 → 3.1
Time: 2.5s
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 \left(-y\right)\right) \cdot z\\ \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 \left(-y\right)\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r262860 = x;
        double r262861 = 1.0;
        double r262862 = y;
        double r262863 = z;
        double r262864 = r262862 * r262863;
        double r262865 = r262861 - r262864;
        double r262866 = r262860 * r262865;
        return r262866;
}

double f(double x, double y, double z) {
        double r262867 = y;
        double r262868 = -3.671253073044598e+138;
        bool r262869 = r262867 <= r262868;
        double r262870 = 1.960803050623658e+71;
        bool r262871 = r262867 <= r262870;
        double r262872 = 6.198127841043233e+226;
        bool r262873 = r262867 <= r262872;
        double r262874 = !r262873;
        bool r262875 = r262871 || r262874;
        double r262876 = !r262875;
        bool r262877 = r262869 || r262876;
        double r262878 = x;
        double r262879 = 1.0;
        double r262880 = r262878 * r262879;
        double r262881 = -r262867;
        double r262882 = r262878 * r262881;
        double r262883 = z;
        double r262884 = r262882 * r262883;
        double r262885 = r262880 + r262884;
        double r262886 = r262867 * r262883;
        double r262887 = -r262886;
        double r262888 = r262878 * r262887;
        double r262889 = r262880 + r262888;
        double r262890 = r262877 ? r262885 : r262889;
        return r262890;
}

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-lft-neg-in10.2

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

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

    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 \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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