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(-z\right) \cdot \left(x \cdot y\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(-z\right) \cdot \left(x \cdot y\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(-z\right) \cdot \left(x \cdot y\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(-z\right) \cdot \left(x \cdot y\right)\\

\end{array}
double f(double x, double y, double z) {
        double r15456877 = x;
        double r15456878 = 1.0;
        double r15456879 = y;
        double r15456880 = z;
        double r15456881 = r15456879 * r15456880;
        double r15456882 = r15456878 - r15456881;
        double r15456883 = r15456877 * r15456882;
        return r15456883;
}

double f(double x, double y, double z) {
        double r15456884 = y;
        double r15456885 = z;
        double r15456886 = r15456884 * r15456885;
        double r15456887 = -inf.0;
        bool r15456888 = r15456886 <= r15456887;
        double r15456889 = x;
        double r15456890 = 1.0;
        double r15456891 = r15456889 * r15456890;
        double r15456892 = -r15456885;
        double r15456893 = r15456889 * r15456884;
        double r15456894 = r15456892 * r15456893;
        double r15456895 = r15456891 + r15456894;
        double r15456896 = 5.779118158975778e+285;
        bool r15456897 = r15456886 <= r15456896;
        double r15456898 = r15456890 - r15456886;
        double r15456899 = r15456898 * r15456889;
        double r15456900 = r15456897 ? r15456899 : r15456895;
        double r15456901 = r15456888 ? r15456895 : r15456900;
        return r15456901;
}

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-rgt-neg-in53.4

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

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

    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(-z\right) \cdot \left(x \cdot y\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(-z\right) \cdot \left(x \cdot y\right)\\ \end{array}\]

Reproduce

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