Average Error: 3.2 → 0.4
Time: 3.7s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -1.7449673406235985 \cdot 10^{+115} \lor \neg \left(y \cdot z \leq 1.0069146892886103 \cdot 10^{+242}\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 -1.7449673406235985 \cdot 10^{+115} \lor \neg \left(y \cdot z \leq 1.0069146892886103 \cdot 10^{+242}\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)) <= -1.7449673406235985e+115) || !(((double) (y * z)) <= 1.0069146892886103e+242))) {
		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) < -1.74496734062359847e115 or 1.0069146892886103e242 < (* y z)

    1. Initial program Error: 20.1 bits

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

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

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

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

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

    if -1.74496734062359847e115 < (* y z) < 1.0069146892886103e242

    1. Initial program Error: 0.1 bits

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -1.7449673406235985 \cdot 10^{+115} \lor \neg \left(y \cdot z \leq 1.0069146892886103 \cdot 10^{+242}\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 2020200 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1.0 (* y z))))