Average Error: 3.4 → 0.9
Time: 7.6s
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 \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.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 \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 r193581 = x;
        double r193582 = 1.0;
        double r193583 = y;
        double r193584 = z;
        double r193585 = r193583 * r193584;
        double r193586 = r193582 - r193585;
        double r193587 = r193581 * r193586;
        return r193587;
}

double f(double x, double y, double z) {
        double r193588 = y;
        double r193589 = z;
        double r193590 = r193588 * r193589;
        double r193591 = -1.6429161822787508e+58;
        bool r193592 = r193590 <= r193591;
        double r193593 = 1.1216381272031817e+279;
        bool r193594 = r193590 <= r193593;
        double r193595 = !r193594;
        bool r193596 = r193592 || r193595;
        double r193597 = x;
        double r193598 = 1.0;
        double r193599 = r193597 * r193598;
        double r193600 = r193597 * r193588;
        double r193601 = -r193589;
        double r193602 = r193600 * r193601;
        double r193603 = r193599 + r193602;
        double r193604 = -r193590;
        double r193605 = r193597 * r193604;
        double r193606 = r193599 + r193605;
        double r193607 = r193596 ? r193603 : r193606;
        return r193607;
}

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-rgt-neg-in18.1

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

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

    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 \left(-z\right)\\ \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))))