Average Error: 3.2 → 0.2
Time: 5.1s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z \cdot y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r275733 = x;
        double r275734 = 1.0;
        double r275735 = y;
        double r275736 = z;
        double r275737 = r275735 * r275736;
        double r275738 = r275734 - r275737;
        double r275739 = r275733 * r275738;
        return r275739;
}

double f(double x, double y, double z) {
        double r275740 = y;
        double r275741 = z;
        double r275742 = r275740 * r275741;
        double r275743 = -6.493405250404478e+306;
        bool r275744 = r275742 <= r275743;
        double r275745 = 3.0707001026583607e+167;
        bool r275746 = r275742 <= r275745;
        double r275747 = !r275746;
        bool r275748 = r275744 || r275747;
        double r275749 = x;
        double r275750 = 1.0;
        double r275751 = r275749 * r275750;
        double r275752 = r275749 * r275740;
        double r275753 = -r275741;
        double r275754 = r275752 * r275753;
        double r275755 = r275751 + r275754;
        double r275756 = r275741 * r275740;
        double r275757 = r275750 - r275756;
        double r275758 = r275749 * r275757;
        double r275759 = r275748 ? r275755 : r275758;
        return r275759;
}

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) < -6.493405250404478e+306 or 3.0707001026583607e+167 < (* y z)

    1. Initial program 32.9

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

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

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

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

    if -6.493405250404478e+306 < (* y z) < 3.0707001026583607e+167

    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. Using strategy rm
    6. Applied distribute-rgt-neg-in0.1

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

      \[\leadsto x \cdot 1 + \color{blue}{\left(x \cdot y\right) \cdot \left(-z\right)}\]
    8. Taylor expanded around inf 0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - z \cdot y\right)\\ \end{array}\]

Reproduce

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