Average Error: 3.3 → 1.9
Time: 2.7s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -5.982341830962904 \cdot 10^{+165}:\\ \;\;\;\;x \cdot 1 + z \cdot \left(y \cdot \left(-x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(y \cdot z\right) \cdot \left(-x\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -5.982341830962904 \cdot 10^{+165}:\\
\;\;\;\;x \cdot 1 + z \cdot \left(y \cdot \left(-x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x \cdot 1 + \left(y \cdot z\right) \cdot \left(-x\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) (y * z)) <= -5.982341830962904e+165)) {
		VAR = ((double) (((double) (x * 1.0)) + ((double) (z * ((double) (y * ((double) -(x))))))));
	} else {
		VAR = ((double) (((double) (x * 1.0)) + ((double) (((double) (y * z)) * ((double) -(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) < -5.9823418309629038e165

    1. Initial program 20.9

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

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

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

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

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

    if -5.9823418309629038e165 < (* y z)

    1. Initial program 1.8

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

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

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

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

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

Reproduce

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