Average Error: 3.0 → 0.1
Time: 13.6s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 5.779118158975778 \cdot 10^{+285}:\\ \;\;\;\;\left(1.0 - y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z = -\infty:\\
\;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\

\mathbf{elif}\;y \cdot z \le 5.779118158975778 \cdot 10^{+285}:\\
\;\;\;\;\left(1.0 - y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r12122598 = x;
        double r12122599 = 1.0;
        double r12122600 = y;
        double r12122601 = z;
        double r12122602 = r12122600 * r12122601;
        double r12122603 = r12122599 - r12122602;
        double r12122604 = r12122598 * r12122603;
        return r12122604;
}

double f(double x, double y, double z) {
        double r12122605 = y;
        double r12122606 = z;
        double r12122607 = r12122605 * r12122606;
        double r12122608 = -inf.0;
        bool r12122609 = r12122607 <= r12122608;
        double r12122610 = x;
        double r12122611 = 1.0;
        double r12122612 = r12122610 * r12122611;
        double r12122613 = r12122610 * r12122605;
        double r12122614 = -r12122606;
        double r12122615 = r12122613 * r12122614;
        double r12122616 = r12122612 + r12122615;
        double r12122617 = 5.779118158975778e+285;
        bool r12122618 = r12122607 <= r12122617;
        double r12122619 = r12122611 - r12122607;
        double r12122620 = r12122619 * r12122610;
        double r12122621 = r12122618 ? r12122620 : r12122616;
        double r12122622 = r12122609 ? r12122616 : r12122621;
        return r12122622;
}

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) < -inf.0 or 5.779118158975778e+285 < (* y z)

    1. Initial program 53.4

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

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

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

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

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

    if -inf.0 < (* y z) < 5.779118158975778e+285

    1. Initial program 0.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z = -\infty:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \mathbf{elif}\;y \cdot z \le 5.779118158975778 \cdot 10^{+285}:\\ \;\;\;\;\left(1.0 - y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1.0 + \left(x \cdot y\right) \cdot \left(-z\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  (* x (- 1.0 (* y z))))