Average Error: 3.4 → 1.7
Time: 2.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.0248910888714283 \cdot 10^{201}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 1.0248910888714283 \cdot 10^{201}:\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r247600 = x;
        double r247601 = 1.0;
        double r247602 = y;
        double r247603 = z;
        double r247604 = r247602 * r247603;
        double r247605 = r247601 - r247604;
        double r247606 = r247600 * r247605;
        return r247606;
}

double f(double x, double y, double z) {
        double r247607 = y;
        double r247608 = z;
        double r247609 = r247607 * r247608;
        double r247610 = 1.0248910888714283e+201;
        bool r247611 = r247609 <= r247610;
        double r247612 = x;
        double r247613 = 1.0;
        double r247614 = r247612 * r247613;
        double r247615 = -r247609;
        double r247616 = r247612 * r247615;
        double r247617 = r247614 + r247616;
        double r247618 = r247612 * r247607;
        double r247619 = -r247608;
        double r247620 = r247618 * r247619;
        double r247621 = r247614 + r247620;
        double r247622 = r247611 ? r247617 : r247621;
        return r247622;
}

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.0248910888714283e+201

    1. Initial program 1.7

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

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

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

    if 1.0248910888714283e+201 < (* y z)

    1. Initial program 27.4

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

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

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

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

      \[\leadsto x \cdot 1 + \color{blue}{\left(x \cdot y\right) \cdot \left(-z\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le 1.0248910888714283 \cdot 10^{201}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]

Reproduce

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