Average Error: 3.0 → 1.6
Time: 12.1s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.85128359392994435305280291229333409072 \cdot 10^{218}:\\ \;\;\;\;x \cdot 1 + \left(-y \cdot z\right) \cdot x\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + y \cdot \left(-z \cdot x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 1.85128359392994435305280291229333409072 \cdot 10^{218}:\\
\;\;\;\;x \cdot 1 + \left(-y \cdot z\right) \cdot x\\

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

\end{array}
double f(double x, double y, double z) {
        double r321709 = x;
        double r321710 = 1.0;
        double r321711 = y;
        double r321712 = z;
        double r321713 = r321711 * r321712;
        double r321714 = r321710 - r321713;
        double r321715 = r321709 * r321714;
        return r321715;
}

double f(double x, double y, double z) {
        double r321716 = y;
        double r321717 = z;
        double r321718 = r321716 * r321717;
        double r321719 = 1.8512835939299444e+218;
        bool r321720 = r321718 <= r321719;
        double r321721 = x;
        double r321722 = 1.0;
        double r321723 = r321721 * r321722;
        double r321724 = -r321718;
        double r321725 = r321724 * r321721;
        double r321726 = r321723 + r321725;
        double r321727 = r321717 * r321721;
        double r321728 = -r321727;
        double r321729 = r321716 * r321728;
        double r321730 = r321723 + r321729;
        double r321731 = r321720 ? r321726 : r321730;
        return r321731;
}

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) < 1.8512835939299444e+218

    1. Initial program 1.6

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

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

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

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

    if 1.8512835939299444e+218 < (* y z)

    1. Initial program 28.4

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

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

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

      \[\leadsto x \cdot 1 + \color{blue}{\left(-y \cdot z\right) \cdot x}\]
    6. Using strategy rm
    7. Applied distribute-rgt-neg-in28.4

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

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

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

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

Reproduce

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