Average Error: 3.3 → 0.2
Time: 14.3s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\
\;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r163750 = x;
        double r163751 = 1.0;
        double r163752 = y;
        double r163753 = z;
        double r163754 = r163752 * r163753;
        double r163755 = r163751 - r163754;
        double r163756 = r163750 * r163755;
        return r163756;
}

double f(double x, double y, double z) {
        double r163757 = y;
        double r163758 = z;
        double r163759 = r163757 * r163758;
        double r163760 = -1.1768564783148908e+221;
        bool r163761 = r163759 <= r163760;
        double r163762 = 7.312372482130219e+187;
        bool r163763 = r163759 <= r163762;
        double r163764 = !r163763;
        bool r163765 = r163761 || r163764;
        double r163766 = 1.0;
        double r163767 = x;
        double r163768 = r163766 * r163767;
        double r163769 = -r163767;
        double r163770 = r163758 * r163769;
        double r163771 = r163757 * r163770;
        double r163772 = r163768 + r163771;
        double r163773 = -r163759;
        double r163774 = r163773 * r163767;
        double r163775 = r163768 + r163774;
        double r163776 = r163765 ? r163772 : r163775;
        return r163776;
}

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.1768564783148908e+221 or 7.312372482130219e+187 < (* y z)

    1. Initial program 27.5

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

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

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

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

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

      \[\leadsto 1 \cdot x + \color{blue}{\left(y \cdot \left(-z\right)\right)} \cdot x\]
    9. Applied associate-*l*1.2

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

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

    if -1.1768564783148908e+221 < (* y z) < 7.312372482130219e+187

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.17685647831489084453456189150995397973 \cdot 10^{221} \lor \neg \left(y \cdot z \le 7.312372482130218940754485960634465779355 \cdot 10^{187}\right):\\ \;\;\;\;1 \cdot x + y \cdot \left(z \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot x + \left(-y \cdot z\right) \cdot x\\ \end{array}\]

Reproduce

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