Average Error: 3.4 → 0.9
Time: 7.1s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\ \;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\ \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.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\
\;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r260425 = x;
        double r260426 = 1.0;
        double r260427 = y;
        double r260428 = z;
        double r260429 = r260427 * r260428;
        double r260430 = r260426 - r260429;
        double r260431 = r260425 * r260430;
        return r260431;
}

double f(double x, double y, double z) {
        double r260432 = y;
        double r260433 = z;
        double r260434 = r260432 * r260433;
        double r260435 = -1.6429161822787508e+58;
        bool r260436 = r260434 <= r260435;
        double r260437 = 1.1216381272031817e+279;
        bool r260438 = r260434 <= r260437;
        double r260439 = !r260438;
        bool r260440 = r260436 || r260439;
        double r260441 = x;
        double r260442 = 1.0;
        double r260443 = r260441 * r260442;
        double r260444 = r260441 * r260432;
        double r260445 = -r260444;
        double r260446 = r260445 * r260433;
        double r260447 = r260443 + r260446;
        double r260448 = -r260434;
        double r260449 = r260441 * r260448;
        double r260450 = r260443 + r260449;
        double r260451 = r260440 ? r260447 : r260450;
        return r260451;
}

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.6429161822787508e+58 or 1.1216381272031817e+279 < (* y z)

    1. Initial program 18.1

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

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

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

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

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

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

    if -1.6429161822787508e+58 < (* y z) < 1.1216381272031817e+279

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.6429161822787508 \cdot 10^{58} \lor \neg \left(y \cdot z \le 1.1216381272031817 \cdot 10^{279}\right):\\ \;\;\;\;x \cdot 1 + \left(-x \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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