Average Error: 3.2 → 0.2
Time: 11.0s
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):\\ \;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\ \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 -6.4934052504044776 \cdot 10^{306} \lor \neg \left(y \cdot z \le 3.0707001026583607 \cdot 10^{167}\right):\\
\;\;\;\;1 \cdot x + \left(-x \cdot y\right) \cdot z\\

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

\end{array}
double f(double x, double y, double z) {
        double r298892 = x;
        double r298893 = 1.0;
        double r298894 = y;
        double r298895 = z;
        double r298896 = r298894 * r298895;
        double r298897 = r298893 - r298896;
        double r298898 = r298892 * r298897;
        return r298898;
}

double f(double x, double y, double z) {
        double r298899 = y;
        double r298900 = z;
        double r298901 = r298899 * r298900;
        double r298902 = -6.493405250404478e+306;
        bool r298903 = r298901 <= r298902;
        double r298904 = 3.0707001026583607e+167;
        bool r298905 = r298901 <= r298904;
        double r298906 = !r298905;
        bool r298907 = r298903 || r298906;
        double r298908 = 1.0;
        double r298909 = x;
        double r298910 = r298908 * r298909;
        double r298911 = r298909 * r298899;
        double r298912 = -r298911;
        double r298913 = r298912 * r298900;
        double r298914 = r298910 + r298913;
        double r298915 = -r298901;
        double r298916 = r298909 * r298915;
        double r298917 = r298910 + r298916;
        double r298918 = r298907 ? r298914 : r298917;
        return r298918;
}

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. Simplified32.9

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

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

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

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

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

Reproduce

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