Average Error: 3.5 → 0.8
Time: 14.4s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.387439253831378329113104867639571109361 \cdot 10^{71} \lor \neg \left(y \cdot z \le 4.284089717899132673056405413227072964625 \cdot 10^{211}\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.387439253831378329113104867639571109361 \cdot 10^{71} \lor \neg \left(y \cdot z \le 4.284089717899132673056405413227072964625 \cdot 10^{211}\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 r132579 = x;
        double r132580 = 1.0;
        double r132581 = y;
        double r132582 = z;
        double r132583 = r132581 * r132582;
        double r132584 = r132580 - r132583;
        double r132585 = r132579 * r132584;
        return r132585;
}

double f(double x, double y, double z) {
        double r132586 = y;
        double r132587 = z;
        double r132588 = r132586 * r132587;
        double r132589 = -1.3874392538313783e+71;
        bool r132590 = r132588 <= r132589;
        double r132591 = 4.284089717899133e+211;
        bool r132592 = r132588 <= r132591;
        double r132593 = !r132592;
        bool r132594 = r132590 || r132593;
        double r132595 = 1.0;
        double r132596 = x;
        double r132597 = r132595 * r132596;
        double r132598 = -r132596;
        double r132599 = r132587 * r132598;
        double r132600 = r132586 * r132599;
        double r132601 = r132597 + r132600;
        double r132602 = -r132588;
        double r132603 = r132602 * r132596;
        double r132604 = r132597 + r132603;
        double r132605 = r132594 ? r132601 : r132604;
        return r132605;
}

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.3874392538313783e+71 or 4.284089717899133e+211 < (* y z)

    1. Initial program 17.9

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

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

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

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

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

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

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

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

    if -1.3874392538313783e+71 < (* y z) < 4.284089717899133e+211

    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.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.387439253831378329113104867639571109361 \cdot 10^{71} \lor \neg \left(y \cdot z \le 4.284089717899132673056405413227072964625 \cdot 10^{211}\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 2019347 +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))))