Average Error: 3.4 → 0.2
Time: 3.3s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -6.519036621544818 \cdot 10^{+266} \lor \neg \left(y \cdot z \leq 3.807495575138799 \cdot 10^{+241}\right):\\ \;\;\;\;x \cdot 1 - z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 - \left(y \cdot z\right) \cdot x\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -6.519036621544818 \cdot 10^{+266} \lor \neg \left(y \cdot z \leq 3.807495575138799 \cdot 10^{+241}\right):\\
\;\;\;\;x \cdot 1 - z \cdot \left(y \cdot x\right)\\

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

\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) (y * z)) <= -6.519036621544818e+266) || !(((double) (y * z)) <= 3.807495575138799e+241))) {
		VAR = ((double) (((double) (x * 1.0)) - ((double) (z * ((double) (y * x))))));
	} else {
		VAR = ((double) (((double) (x * 1.0)) - ((double) (((double) (y * z)) * x))));
	}
	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 (* y z) < -6.5190366215448184e266 or 3.8074955751387988e241 < (* y z)

    1. Initial program 40.4

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

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

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

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

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

    if -6.5190366215448184e266 < (* y z) < 3.8074955751387988e241

    1. Initial program 0.1

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -6.519036621544818 \cdot 10^{+266} \lor \neg \left(y \cdot z \leq 3.807495575138799 \cdot 10^{+241}\right):\\ \;\;\;\;x \cdot 1 - z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 - \left(y \cdot z\right) \cdot x\\ \end{array}\]

Reproduce

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