Average Error: 3.5 → 0.2
Time: 3.7s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -5.502853476493287108664067547505324618218 \cdot 10^{273} \lor \neg \left(y \cdot z \le 9.798575094590936461122103996339115341588 \cdot 10^{168}\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 -5.502853476493287108664067547505324618218 \cdot 10^{273} \lor \neg \left(y \cdot z \le 9.798575094590936461122103996339115341588 \cdot 10^{168}\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 r274896 = x;
        double r274897 = 1.0;
        double r274898 = y;
        double r274899 = z;
        double r274900 = r274898 * r274899;
        double r274901 = r274897 - r274900;
        double r274902 = r274896 * r274901;
        return r274902;
}

double f(double x, double y, double z) {
        double r274903 = y;
        double r274904 = z;
        double r274905 = r274903 * r274904;
        double r274906 = -5.502853476493287e+273;
        bool r274907 = r274905 <= r274906;
        double r274908 = 9.798575094590936e+168;
        bool r274909 = r274905 <= r274908;
        double r274910 = !r274909;
        bool r274911 = r274907 || r274910;
        double r274912 = x;
        double r274913 = 1.0;
        double r274914 = r274912 * r274913;
        double r274915 = r274912 * r274903;
        double r274916 = -r274904;
        double r274917 = r274915 * r274916;
        double r274918 = r274914 + r274917;
        double r274919 = -r274905;
        double r274920 = r274912 * r274919;
        double r274921 = r274914 + r274920;
        double r274922 = r274911 ? r274918 : r274921;
        return r274922;
}

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) < -5.502853476493287e+273 or 9.798575094590936e+168 < (* y z)

    1. Initial program 29.3

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

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

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

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

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

    if -5.502853476493287e+273 < (* y z) < 9.798575094590936e+168

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -5.502853476493287108664067547505324618218 \cdot 10^{273} \lor \neg \left(y \cdot z \le 9.798575094590936461122103996339115341588 \cdot 10^{168}\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 2019362 +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))))