Average Error: 3.3 → 0.3
Time: 2.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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 \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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 r300031 = x;
        double r300032 = 1.0;
        double r300033 = y;
        double r300034 = z;
        double r300035 = r300033 * r300034;
        double r300036 = r300032 - r300035;
        double r300037 = r300031 * r300036;
        return r300037;
}

double f(double x, double y, double z) {
        double r300038 = y;
        double r300039 = z;
        double r300040 = r300038 * r300039;
        double r300041 = -1.8511185685143662e+157;
        bool r300042 = r300040 <= r300041;
        double r300043 = 7.089590365379835e+176;
        bool r300044 = r300040 <= r300043;
        double r300045 = !r300044;
        bool r300046 = r300042 || r300045;
        double r300047 = x;
        double r300048 = 1.0;
        double r300049 = r300047 * r300048;
        double r300050 = r300047 * r300038;
        double r300051 = -r300039;
        double r300052 = r300050 * r300051;
        double r300053 = r300049 + r300052;
        double r300054 = -r300040;
        double r300055 = r300047 * r300054;
        double r300056 = r300049 + r300055;
        double r300057 = r300046 ? r300053 : r300056;
        return r300057;
}

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) < -1.8511185685143662e+157 or 7.089590365379835e+176 < (* y z)

    1. Initial program 20.5

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

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

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

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

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

    if -1.8511185685143662e+157 < (* y z) < 7.089590365379835e+176

    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.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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 2020060 +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))))