Average Error: 3.5 → 1.7
Time: 11.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -6949831.680780823342502117156982421875 \lor \neg \left(x \le 2.491039033444159976790174665792217761542 \cdot 10^{89}\right):\\ \;\;\;\;x \cdot 1 + \left(-z \cdot y\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(-z\right) \cdot \left(y \cdot x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;x \le -6949831.680780823342502117156982421875 \lor \neg \left(x \le 2.491039033444159976790174665792217761542 \cdot 10^{89}\right):\\
\;\;\;\;x \cdot 1 + \left(-z \cdot y\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r223152 = x;
        double r223153 = 1.0;
        double r223154 = y;
        double r223155 = z;
        double r223156 = r223154 * r223155;
        double r223157 = r223153 - r223156;
        double r223158 = r223152 * r223157;
        return r223158;
}

double f(double x, double y, double z) {
        double r223159 = x;
        double r223160 = -6949831.680780823;
        bool r223161 = r223159 <= r223160;
        double r223162 = 2.49103903344416e+89;
        bool r223163 = r223159 <= r223162;
        double r223164 = !r223163;
        bool r223165 = r223161 || r223164;
        double r223166 = 1.0;
        double r223167 = r223159 * r223166;
        double r223168 = z;
        double r223169 = y;
        double r223170 = r223168 * r223169;
        double r223171 = -r223170;
        double r223172 = r223171 * r223159;
        double r223173 = r223167 + r223172;
        double r223174 = -r223168;
        double r223175 = r223169 * r223159;
        double r223176 = r223174 * r223175;
        double r223177 = r223167 + r223176;
        double r223178 = r223165 ? r223173 : r223177;
        return r223178;
}

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 x < -6949831.680780823 or 2.49103903344416e+89 < x

    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 x \cdot 1 + \color{blue}{\left(-z \cdot y\right) \cdot x}\]

    if -6949831.680780823 < x < 2.49103903344416e+89

    1. Initial program 5.4

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

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

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

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

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

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

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

Reproduce

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