Average Error: 3.3 → 0.3
Time: 2.6s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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 r243606 = x;
        double r243607 = 1.0;
        double r243608 = y;
        double r243609 = z;
        double r243610 = r243608 * r243609;
        double r243611 = r243607 - r243610;
        double r243612 = r243606 * r243611;
        return r243612;
}

double f(double x, double y, double z) {
        double r243613 = y;
        double r243614 = z;
        double r243615 = r243613 * r243614;
        double r243616 = -1.8511185685143662e+157;
        bool r243617 = r243615 <= r243616;
        double r243618 = 7.089590365379835e+176;
        bool r243619 = r243615 <= r243618;
        double r243620 = !r243619;
        bool r243621 = r243617 || r243620;
        double r243622 = x;
        double r243623 = 1.0;
        double r243624 = r243622 * r243623;
        double r243625 = r243622 * r243613;
        double r243626 = -r243614;
        double r243627 = r243625 * r243626;
        double r243628 = r243624 + r243627;
        double r243629 = -r243615;
        double r243630 = r243622 * r243629;
        double r243631 = r243624 + r243630;
        double r243632 = r243621 ? r243628 : r243631;
        return r243632;
}

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.8511185685143662e+157 or 7.089590365379835e+176 < (* y z)

    1. Initial program 20.5

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

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

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

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

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

    if -1.8511185685143662e+157 < (* y z) < 7.089590365379835e+176

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.8511185685143662 \cdot 10^{157} \lor \neg \left(y \cdot z \le 7.0895903653798347 \cdot 10^{176}\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 2020060 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1 (* y z))))