Average Error: 3.5 → 0.4
Time: 11.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -3.151311147907514591177224973947536932796 \cdot 10^{267} \lor \neg \left(y \cdot z \le 1.474260842553683874369765813109773677606 \cdot 10^{147}\right):\\ \;\;\;\;1 \cdot x + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + 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 -3.151311147907514591177224973947536932796 \cdot 10^{267} \lor \neg \left(y \cdot z \le 1.474260842553683874369765813109773677606 \cdot 10^{147}\right):\\
\;\;\;\;1 \cdot x + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r189612 = x;
        double r189613 = 1.0;
        double r189614 = y;
        double r189615 = z;
        double r189616 = r189614 * r189615;
        double r189617 = r189613 - r189616;
        double r189618 = r189612 * r189617;
        return r189618;
}

double f(double x, double y, double z) {
        double r189619 = y;
        double r189620 = z;
        double r189621 = r189619 * r189620;
        double r189622 = -3.1513111479075146e+267;
        bool r189623 = r189621 <= r189622;
        double r189624 = 1.4742608425536839e+147;
        bool r189625 = r189621 <= r189624;
        double r189626 = !r189625;
        bool r189627 = r189623 || r189626;
        double r189628 = 1.0;
        double r189629 = x;
        double r189630 = r189628 * r189629;
        double r189631 = r189629 * r189619;
        double r189632 = -r189620;
        double r189633 = r189631 * r189632;
        double r189634 = r189630 + r189633;
        double r189635 = -r189621;
        double r189636 = r189629 * r189635;
        double r189637 = r189630 + r189636;
        double r189638 = r189627 ? r189634 : r189637;
        return r189638;
}

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) < -3.1513111479075146e+267 or 1.4742608425536839e+147 < (* y z)

    1. Initial program 27.0

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

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

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

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

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

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

    if -3.1513111479075146e+267 < (* y z) < 1.4742608425536839e+147

    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)}\]
    5. Simplified0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -3.151311147907514591177224973947536932796 \cdot 10^{267} \lor \neg \left(y \cdot z \le 1.474260842553683874369765813109773677606 \cdot 10^{147}\right):\\ \;\;\;\;1 \cdot x + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + x \cdot \left(-y \cdot z\right)\\ \end{array}\]

Reproduce

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