Average Error: 3.5 → 3.3
Time: 9.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.056440915500975316758450912169295281422 \cdot 10^{58}:\\ \;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot \left(x \cdot z\right)\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;x \le -3.056440915500975316758450912169295281422 \cdot 10^{58}:\\
\;\;\;\;1 \cdot x + \left(-z \cdot y\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r227986 = x;
        double r227987 = 1.0;
        double r227988 = y;
        double r227989 = z;
        double r227990 = r227988 * r227989;
        double r227991 = r227987 - r227990;
        double r227992 = r227986 * r227991;
        return r227992;
}

double f(double x, double y, double z) {
        double r227993 = x;
        double r227994 = -3.0564409155009753e+58;
        bool r227995 = r227993 <= r227994;
        double r227996 = 1.0;
        double r227997 = r227996 * r227993;
        double r227998 = z;
        double r227999 = y;
        double r228000 = r227998 * r227999;
        double r228001 = -r228000;
        double r228002 = r228001 * r227993;
        double r228003 = r227997 + r228002;
        double r228004 = r227993 * r227998;
        double r228005 = r227999 * r228004;
        double r228006 = -r228005;
        double r228007 = r227997 + r228006;
        double r228008 = r227995 ? r228003 : r228007;
        return r228008;
}

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 x < -3.0564409155009753e+58

    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)}\]
    5. Simplified0.1

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

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

    if -3.0564409155009753e+58 < x

    1. Initial program 4.2

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

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(-z \cdot y\right) \cdot x}\]
    7. Using strategy rm
    8. Applied distribute-lft-neg-out4.1

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

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

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

Reproduce

herbie shell --seed 2019305 +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))))