Average Error: 3.4 → 2.0
Time: 2.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le 1.9090983248053632 \cdot 10^{152}:\\ \;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le 1.9090983248053632 \cdot 10^{152}:\\
\;\;\;\;x \cdot 1 + x \cdot \left(-y \cdot z\right)\\

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

\end{array}
double f(double x, double y, double z) {
        double r314686 = x;
        double r314687 = 1.0;
        double r314688 = y;
        double r314689 = z;
        double r314690 = r314688 * r314689;
        double r314691 = r314687 - r314690;
        double r314692 = r314686 * r314691;
        return r314692;
}

double f(double x, double y, double z) {
        double r314693 = y;
        double r314694 = z;
        double r314695 = r314693 * r314694;
        double r314696 = 1.9090983248053632e+152;
        bool r314697 = r314695 <= r314696;
        double r314698 = x;
        double r314699 = 1.0;
        double r314700 = r314698 * r314699;
        double r314701 = -r314695;
        double r314702 = r314698 * r314701;
        double r314703 = r314700 + r314702;
        double r314704 = -r314693;
        double r314705 = r314698 * r314704;
        double r314706 = r314705 * r314694;
        double r314707 = r314700 + r314706;
        double r314708 = r314697 ? r314703 : r314707;
        return r314708;
}

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.9090983248053632e+152

    1. Initial program 1.9

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

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

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

    if 1.9090983248053632e+152 < (* y z)

    1. Initial program 19.4

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

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

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

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

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

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

Reproduce

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