Average Error: 3.4 → 0.2
Time: 12.7s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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 r331168 = x;
        double r331169 = 1.0;
        double r331170 = y;
        double r331171 = z;
        double r331172 = r331170 * r331171;
        double r331173 = r331169 - r331172;
        double r331174 = r331168 * r331173;
        return r331174;
}

double f(double x, double y, double z) {
        double r331175 = y;
        double r331176 = z;
        double r331177 = r331175 * r331176;
        double r331178 = -1.0105387772936745e+256;
        bool r331179 = r331177 <= r331178;
        double r331180 = 8.808189473162537e+223;
        bool r331181 = r331177 <= r331180;
        double r331182 = !r331181;
        bool r331183 = r331179 || r331182;
        double r331184 = x;
        double r331185 = 1.0;
        double r331186 = r331184 * r331185;
        double r331187 = r331184 * r331175;
        double r331188 = -r331176;
        double r331189 = r331187 * r331188;
        double r331190 = r331186 + r331189;
        double r331191 = -r331177;
        double r331192 = r331184 * r331191;
        double r331193 = r331186 + r331192;
        double r331194 = r331183 ? r331190 : r331193;
        return r331194;
}

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.0105387772936745e+256 or 8.808189473162537e+223 < (* y z)

    1. Initial program 35.4

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

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

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

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

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

    if -1.0105387772936745e+256 < (* y z) < 8.808189473162537e+223

    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 -1.01053877729367452 \cdot 10^{256} \lor \neg \left(y \cdot z \le 8.8081894731625367 \cdot 10^{223}\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 2020042 +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))))