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 \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 r281599 = x;
        double r281600 = 1.0;
        double r281601 = y;
        double r281602 = z;
        double r281603 = r281601 * r281602;
        double r281604 = r281600 - r281603;
        double r281605 = r281599 * r281604;
        return r281605;
}

double f(double x, double y, double z) {
        double r281606 = y;
        double r281607 = -3.671253073044598e+138;
        bool r281608 = r281606 <= r281607;
        double r281609 = 1.960803050623658e+71;
        bool r281610 = r281606 <= r281609;
        double r281611 = 6.198127841043233e+226;
        bool r281612 = r281606 <= r281611;
        double r281613 = !r281612;
        bool r281614 = r281610 || r281613;
        double r281615 = !r281614;
        bool r281616 = r281608 || r281615;
        double r281617 = x;
        double r281618 = 1.0;
        double r281619 = r281617 * r281618;
        double r281620 = -r281606;
        double r281621 = r281617 * r281620;
        double r281622 = z;
        double r281623 = r281621 * r281622;
        double r281624 = r281619 + r281623;
        double r281625 = r281606 * r281622;
        double r281626 = -r281625;
        double r281627 = r281617 * r281626;
        double r281628 = r281619 + r281627;
        double r281629 = r281616 ? r281624 : r281628;
        return r281629;
}

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