Average Error: 3.3 → 0.4
Time: 8.6s
Precision: 64
\[x \cdot \left(1.0 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -6.149463457675146 \cdot 10^{+185}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 1.1429619896661653 \cdot 10^{+135}:\\ \;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \end{array}\]
x \cdot \left(1.0 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -6.149463457675146 \cdot 10^{+185}:\\
\;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\

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

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

\end{array}
double f(double x, double y, double z) {
        double r11782013 = x;
        double r11782014 = 1.0;
        double r11782015 = y;
        double r11782016 = z;
        double r11782017 = r11782015 * r11782016;
        double r11782018 = r11782014 - r11782017;
        double r11782019 = r11782013 * r11782018;
        return r11782019;
}

double f(double x, double y, double z) {
        double r11782020 = y;
        double r11782021 = z;
        double r11782022 = r11782020 * r11782021;
        double r11782023 = -6.149463457675146e+185;
        bool r11782024 = r11782022 <= r11782023;
        double r11782025 = 1.0;
        double r11782026 = x;
        double r11782027 = r11782025 * r11782026;
        double r11782028 = -r11782026;
        double r11782029 = r11782028 * r11782021;
        double r11782030 = r11782029 * r11782020;
        double r11782031 = r11782027 + r11782030;
        double r11782032 = 1.1429619896661653e+135;
        bool r11782033 = r11782022 <= r11782032;
        double r11782034 = r11782028 * r11782022;
        double r11782035 = r11782034 + r11782027;
        double r11782036 = r11782033 ? r11782035 : r11782031;
        double r11782037 = r11782024 ? r11782031 : r11782036;
        return r11782037;
}

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) < -6.149463457675146e+185 or 1.1429619896661653e+135 < (* y z)

    1. Initial program 19.3

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

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

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

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

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

    if -6.149463457675146e+185 < (* y z) < 1.1429619896661653e+135

    1. Initial program 0.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -6.149463457675146 \cdot 10^{+185}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 1.1429619896661653 \cdot 10^{+135}:\\ \;\;\;\;\left(-x\right) \cdot \left(y \cdot z\right) + 1.0 \cdot x\\ \mathbf{else}:\\ \;\;\;\;1.0 \cdot x + \left(\left(-x\right) \cdot z\right) \cdot y\\ \end{array}\]

Reproduce

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