Average Error: 3.3 → 0.1
Time: 2.9s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8315067533425726 \cdot 10^{262} \lor \neg \left(y \cdot z \le 2.91625953718361343 \cdot 10^{242}\right):\\ \;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + 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 -1.8315067533425726 \cdot 10^{262} \lor \neg \left(y \cdot z \le 2.91625953718361343 \cdot 10^{242}\right):\\
\;\;\;\;x \cdot 1 + \left(x \cdot y\right) \cdot \left(-z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r238549 = x;
        double r238550 = 1.0;
        double r238551 = y;
        double r238552 = z;
        double r238553 = r238551 * r238552;
        double r238554 = r238550 - r238553;
        double r238555 = r238549 * r238554;
        return r238555;
}

double f(double x, double y, double z) {
        double r238556 = y;
        double r238557 = z;
        double r238558 = r238556 * r238557;
        double r238559 = -1.8315067533425726e+262;
        bool r238560 = r238558 <= r238559;
        double r238561 = 2.9162595371836134e+242;
        bool r238562 = r238558 <= r238561;
        double r238563 = !r238562;
        bool r238564 = r238560 || r238563;
        double r238565 = x;
        double r238566 = 1.0;
        double r238567 = r238565 * r238566;
        double r238568 = r238565 * r238556;
        double r238569 = -r238557;
        double r238570 = r238568 * r238569;
        double r238571 = r238567 + r238570;
        double r238572 = -r238558;
        double r238573 = r238565 * r238572;
        double r238574 = r238567 + r238573;
        double r238575 = r238564 ? r238571 : r238574;
        return r238575;
}

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.8315067533425726e+262 or 2.9162595371836134e+242 < (* y z)

    1. Initial program 39.1

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

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

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

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

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

    if -1.8315067533425726e+262 < (* y z) < 2.9162595371836134e+242

    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)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.1

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

Reproduce

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