Average Error: 3.4 → 0.9
Time: 2.2s
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 \left(-y\right)\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 \left(-y\right)\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 r278255 = x;
        double r278256 = 1.0;
        double r278257 = y;
        double r278258 = z;
        double r278259 = r278257 * r278258;
        double r278260 = r278256 - r278259;
        double r278261 = r278255 * r278260;
        return r278261;
}

double f(double x, double y, double z) {
        double r278262 = y;
        double r278263 = z;
        double r278264 = r278262 * r278263;
        double r278265 = -1.6429161822787508e+58;
        bool r278266 = r278264 <= r278265;
        double r278267 = 1.1216381272031817e+279;
        bool r278268 = r278264 <= r278267;
        double r278269 = !r278268;
        bool r278270 = r278266 || r278269;
        double r278271 = x;
        double r278272 = 1.0;
        double r278273 = r278271 * r278272;
        double r278274 = -r278262;
        double r278275 = r278271 * r278274;
        double r278276 = r278275 * r278263;
        double r278277 = r278273 + r278276;
        double r278278 = -r278264;
        double r278279 = r278271 * r278278;
        double r278280 = r278273 + r278279;
        double r278281 = r278270 ? r278277 : r278280;
        return r278281;
}

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}\]

    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 \left(-y\right)\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020046 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))