Average Error: 3.6 → 1.9
Time: 15.4s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\ \;\;\;\;\left(-x \cdot \left(y \cdot z\right)\right) + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(-x\right) \cdot z\right) + 1 \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\
\;\;\;\;\left(-x \cdot \left(y \cdot z\right)\right) + 1 \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r11924898 = x;
        double r11924899 = 1.0;
        double r11924900 = y;
        double r11924901 = z;
        double r11924902 = r11924900 * r11924901;
        double r11924903 = r11924899 - r11924902;
        double r11924904 = r11924898 * r11924903;
        return r11924904;
}

double f(double x, double y, double z) {
        double r11924905 = y;
        double r11924906 = z;
        double r11924907 = r11924905 * r11924906;
        double r11924908 = 9.523507907051805e+193;
        bool r11924909 = r11924907 <= r11924908;
        double r11924910 = x;
        double r11924911 = r11924910 * r11924907;
        double r11924912 = -r11924911;
        double r11924913 = 1.0;
        double r11924914 = r11924913 * r11924910;
        double r11924915 = r11924912 + r11924914;
        double r11924916 = -r11924910;
        double r11924917 = r11924916 * r11924906;
        double r11924918 = r11924905 * r11924917;
        double r11924919 = r11924918 + r11924914;
        double r11924920 = r11924909 ? r11924915 : r11924919;
        return r11924920;
}

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) < 9.523507907051805e+193

    1. Initial program 2.0

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

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

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

    if 9.523507907051805e+193 < (* y z)

    1. Initial program 26.6

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le 9.523507907051804582488023185592807459301 \cdot 10^{193}:\\ \;\;\;\;\left(-x \cdot \left(y \cdot z\right)\right) + 1 \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(\left(-x\right) \cdot z\right) + 1 \cdot x\\ \end{array}\]

Reproduce

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