Average Error: 3.4 → 0.2
Time: 1.8s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -1.45051130796349123 \cdot 10^{202} \lor \neg \left(y \cdot z \le 2.38331320579974366 \cdot 10^{216}\right):\\ \;\;\;\;x \cdot 1 + \left(-z\right) \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -1.45051130796349123 \cdot 10^{202} \lor \neg \left(y \cdot z \le 2.38331320579974366 \cdot 10^{216}\right):\\
\;\;\;\;x \cdot 1 + \left(-z\right) \cdot \left(x \cdot y\right)\\

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

\end{array}
double code(double x, double y, double z) {
	return (x * (1.0 - (y * z)));
}
double code(double x, double y, double z) {
	double VAR;
	if ((((y * z) <= -1.4505113079634912e+202) || !((y * z) <= 2.3833132057997437e+216))) {
		VAR = ((x * 1.0) + (-z * (x * y)));
	} else {
		VAR = (x * (1.0 - (y * z)));
	}
	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.4505113079634912e+202 or 2.3833132057997437e+216 < (* y z)

    1. Initial program 27.9

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

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

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Using strategy rm
    6. Applied *-commutative27.9

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

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

      \[\leadsto x \cdot 1 + \color{blue}{\left(x \cdot \left(-z\right)\right) \cdot y}\]
    9. Using strategy rm
    10. Applied *-commutative0.9

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

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

    if -1.4505113079634912e+202 < (* y z) < 2.3833132057997437e+216

    1. Initial program 0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -1.45051130796349123 \cdot 10^{202} \lor \neg \left(y \cdot z \le 2.38331320579974366 \cdot 10^{216}\right):\\ \;\;\;\;x \cdot 1 + \left(-z\right) \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \end{array}\]

Reproduce

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