Average Error: 3.1 → 1.8
Time: 2.7s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;x \cdot \left(1 - y \cdot z\right) \le 1.7156016384776746 \cdot 10^{288}:\\ \;\;\;\;x \cdot 1 - x \cdot \left(y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 - z \cdot \left(x \cdot y\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;x \cdot \left(1 - y \cdot z\right) \le 1.7156016384776746 \cdot 10^{288}:\\
\;\;\;\;x \cdot 1 - x \cdot \left(y \cdot z\right)\\

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

\end{array}
double code(double x, double y, double z) {
	return ((double) (x * ((double) (1.0 - ((double) (y * z))))));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((double) (x * ((double) (1.0 - ((double) (y * z)))))) <= 1.7156016384776746e+288)) {
		VAR = ((double) (((double) (x * 1.0)) - ((double) (x * ((double) (y * z))))));
	} else {
		VAR = ((double) (((double) (x * 1.0)) - ((double) (z * ((double) (x * y))))));
	}
	return VAR;
}

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 (* x (- 1.0 (* y z))) < 1.7156016384776746e288

    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}{x \cdot \left(y \cdot \left(-z\right)\right)}\]

    if 1.7156016384776746e288 < (* x (- 1.0 (* y z)))

    1. Initial program 37.5

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

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

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

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

      \[\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.8

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

Reproduce

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