Average Error: 3.4 → 0.4
Time: 15.0s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.650641525284493451681908682902370912525 \cdot 10^{168} \lor \neg \left(y \cdot z \le 3.017566192247438581300258437697611878047 \cdot 10^{162}\right):\\ \;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -1.650641525284493451681908682902370912525 \cdot 10^{168} \lor \neg \left(y \cdot z \le 3.017566192247438581300258437697611878047 \cdot 10^{162}\right):\\
\;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r142863 = x;
        double r142864 = 1.0;
        double r142865 = y;
        double r142866 = z;
        double r142867 = r142865 * r142866;
        double r142868 = r142864 - r142867;
        double r142869 = r142863 * r142868;
        return r142869;
}

double f(double x, double y, double z) {
        double r142870 = y;
        double r142871 = z;
        double r142872 = r142870 * r142871;
        double r142873 = -1.6506415252844935e+168;
        bool r142874 = r142872 <= r142873;
        double r142875 = 3.0175661922474386e+162;
        bool r142876 = r142872 <= r142875;
        double r142877 = !r142876;
        bool r142878 = r142874 || r142877;
        double r142879 = 1.0;
        double r142880 = x;
        double r142881 = r142879 * r142880;
        double r142882 = -r142870;
        double r142883 = r142871 * r142880;
        double r142884 = r142882 * r142883;
        double r142885 = r142881 + r142884;
        double r142886 = r142879 - r142872;
        double r142887 = r142880 * r142886;
        double r142888 = r142878 ? r142885 : r142887;
        return r142888;
}

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.6506415252844935e+168 or 3.0175661922474386e+162 < (* y z)

    1. Initial program 21.6

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

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

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(\left(-y\right) \cdot z\right)} \cdot x\]
    9. Applied associate-*l*1.9

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

    if -1.6506415252844935e+168 < (* y z) < 3.0175661922474386e+162

    1. Initial program 0.1

      \[x \cdot \left(1 - y \cdot z\right)\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.650641525284493451681908682902370912525 \cdot 10^{168} \lor \neg \left(y \cdot z \le 3.017566192247438581300258437697611878047 \cdot 10^{162}\right):\\ \;\;\;\;1 \cdot x + \left(-y\right) \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array}\]

Reproduce

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