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

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

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

\end{array}
double f(double x, double y, double z) {
        double r13710924 = x;
        double r13710925 = 1.0;
        double r13710926 = y;
        double r13710927 = z;
        double r13710928 = r13710926 * r13710927;
        double r13710929 = r13710925 - r13710928;
        double r13710930 = r13710924 * r13710929;
        return r13710930;
}

double f(double x, double y, double z) {
        double r13710931 = y;
        double r13710932 = z;
        double r13710933 = r13710931 * r13710932;
        double r13710934 = -inf.0;
        bool r13710935 = r13710933 <= r13710934;
        double r13710936 = 1.0;
        double r13710937 = x;
        double r13710938 = r13710936 * r13710937;
        double r13710939 = r13710931 * r13710937;
        double r13710940 = r13710939 * r13710932;
        double r13710941 = -r13710940;
        double r13710942 = r13710938 + r13710941;
        double r13710943 = 5.779118158975778e+285;
        bool r13710944 = r13710933 <= r13710943;
        double r13710945 = r13710936 - r13710933;
        double r13710946 = r13710945 * r13710937;
        double r13710947 = r13710944 ? r13710946 : r13710942;
        double r13710948 = r13710935 ? r13710942 : r13710947;
        return r13710948;
}

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

      \[\leadsto \color{blue}{1.0 \cdot x + \left(-y \cdot z\right) \cdot x}\]
    5. Taylor expanded around inf 53.4

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

      \[\leadsto 1.0 \cdot x + \color{blue}{\left(-z \cdot \left(y \cdot x\right)\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:\\ \;\;\;\;1.0 \cdot x + \left(-\left(y \cdot x\right) \cdot z\right)\\ \mathbf{elif}\;y \cdot z \le 5.779118158975778 \cdot 10^{+285}:\\ \;\;\;\;\left(1.0 - y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(-\left(y \cdot x\right) \cdot z\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))))