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

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

\end{array}
double f(double x, double y, double z) {
        double r313737 = x;
        double r313738 = 1.0;
        double r313739 = y;
        double r313740 = z;
        double r313741 = r313739 * r313740;
        double r313742 = r313738 - r313741;
        double r313743 = r313737 * r313742;
        return r313743;
}

double f(double x, double y, double z) {
        double r313744 = y;
        double r313745 = z;
        double r313746 = r313744 * r313745;
        double r313747 = 4.3002294164923714e+181;
        bool r313748 = r313746 <= r313747;
        double r313749 = x;
        double r313750 = 1.0;
        double r313751 = r313749 * r313750;
        double r313752 = -r313746;
        double r313753 = r313749 * r313752;
        double r313754 = r313751 + r313753;
        double r313755 = r313749 * r313744;
        double r313756 = -r313745;
        double r313757 = r313755 * r313756;
        double r313758 = r313751 + r313757;
        double r313759 = r313748 ? r313754 : r313758;
        return r313759;
}

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) < 4.3002294164923714e+181

    1. Initial program 1.7

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

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

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

    if 4.3002294164923714e+181 < (* y z)

    1. Initial program 23.0

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

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

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

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

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

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

Reproduce

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