Average Error: 3.6 → 0.5
Time: 2.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\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 -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\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 r247022 = x;
        double r247023 = 1.0;
        double r247024 = y;
        double r247025 = z;
        double r247026 = r247024 * r247025;
        double r247027 = r247023 - r247026;
        double r247028 = r247022 * r247027;
        return r247028;
}

double f(double x, double y, double z) {
        double r247029 = y;
        double r247030 = z;
        double r247031 = r247029 * r247030;
        double r247032 = -2.473742767702468e+275;
        bool r247033 = r247031 <= r247032;
        double r247034 = 5.10649430386231e+115;
        bool r247035 = r247031 <= r247034;
        double r247036 = !r247035;
        bool r247037 = r247033 || r247036;
        double r247038 = x;
        double r247039 = 1.0;
        double r247040 = r247038 * r247039;
        double r247041 = r247038 * r247029;
        double r247042 = -r247030;
        double r247043 = r247041 * r247042;
        double r247044 = r247040 + r247043;
        double r247045 = -r247031;
        double r247046 = r247038 * r247045;
        double r247047 = r247040 + r247046;
        double r247048 = r247037 ? r247044 : r247047;
        return r247048;
}

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) < -2.473742767702468e+275 or 5.10649430386231e+115 < (* y z)

    1. Initial program 24.7

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

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

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

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

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

    if -2.473742767702468e+275 < (* y z) < 5.10649430386231e+115

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -2.47374276770246801 \cdot 10^{275} \lor \neg \left(y \cdot z \le 5.10649430386231042 \cdot 10^{115}\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 2020024 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))