Average Error: 3.4 → 0.1
Time: 2.5s
Precision: 64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \le -8.8700998927921954 \cdot 10^{262}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-z\right)\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 1.07837293158876675 \cdot 10^{303}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;y \cdot z \le -8.8700998927921954 \cdot 10^{262}:\\
\;\;\;\;x \cdot 1 + \left(x \cdot \left(-z\right)\right) \cdot y\\

\mathbf{elif}\;y \cdot z \le 1.07837293158876675 \cdot 10^{303}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\

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

\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)) <= -8.870099892792195e+262)) {
		VAR = ((double) (((double) (x * 1.0)) + ((double) (((double) (x * ((double) -(z)))) * y))));
	} else {
		double VAR_1;
		if ((((double) (y * z)) <= 1.0783729315887667e+303)) {
			VAR_1 = ((double) (((double) (x * ((double) fma(((double) (((double) cbrt(1.0)) * ((double) cbrt(1.0)))), ((double) cbrt(1.0)), ((double) -(((double) (z * y)))))))) + ((double) (x * ((double) fma(((double) -(z)), y, ((double) (z * y))))))));
		} else {
			VAR_1 = ((double) (((double) (x * 1.0)) + ((double) (((double) (x * ((double) -(y)))) * z))));
		}
		VAR = VAR_1;
	}
	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 3 regimes
  2. if (* y z) < -8.870099892792195e+262

    1. Initial program 42.0

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

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

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

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

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

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

    if -8.870099892792195e+262 < (* y z) < 1.0783729315887667e+303

    1. Initial program 0.1

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

      \[\leadsto x \cdot \left(\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}} - y \cdot z\right)\]
    4. Applied prod-diff0.1

      \[\leadsto x \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + \mathsf{fma}\left(-z, y, z \cdot y\right)\right)}\]
    5. Applied distribute-lft-in0.1

      \[\leadsto \color{blue}{x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)}\]

    if 1.0783729315887667e+303 < (* y z)

    1. Initial program 62.3

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

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

      \[\leadsto \color{blue}{x \cdot 1 + x \cdot \left(-y \cdot z\right)}\]
    5. Using strategy rm
    6. Applied distribute-lft-neg-in62.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \le -8.8700998927921954 \cdot 10^{262}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-z\right)\right) \cdot y\\ \mathbf{elif}\;y \cdot z \le 1.07837293158876675 \cdot 10^{303}:\\ \;\;\;\;x \cdot \mathsf{fma}\left(\sqrt[3]{1} \cdot \sqrt[3]{1}, \sqrt[3]{1}, -z \cdot y\right) + x \cdot \mathsf{fma}\left(-z, y, z \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1 + \left(x \cdot \left(-y\right)\right) \cdot z\\ \end{array}\]

Reproduce

herbie shell --seed 2020113 +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))))