Average Error: 3.3 → 0.3
Time: 2.2s
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 r243881 = x;
        double r243882 = 1.0;
        double r243883 = y;
        double r243884 = z;
        double r243885 = r243883 * r243884;
        double r243886 = r243882 - r243885;
        double r243887 = r243881 * r243886;
        return r243887;
}

double f(double x, double y, double z) {
        double r243888 = y;
        double r243889 = z;
        double r243890 = r243888 * r243889;
        double r243891 = -1.8511185685143662e+157;
        bool r243892 = r243890 <= r243891;
        double r243893 = 7.089590365379835e+176;
        bool r243894 = r243890 <= r243893;
        double r243895 = !r243894;
        bool r243896 = r243892 || r243895;
        double r243897 = x;
        double r243898 = 1.0;
        double r243899 = r243897 * r243898;
        double r243900 = r243897 * r243888;
        double r243901 = -r243889;
        double r243902 = r243900 * r243901;
        double r243903 = r243899 + r243902;
        double r243904 = -r243890;
        double r243905 = r243897 * r243904;
        double r243906 = r243899 + r243905;
        double r243907 = r243896 ? r243903 : r243906;
        return r243907;
}

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