Average Error: 2.6 → 1.2
Time: 5.9s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right) \]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -2.5896956365151547 \cdot 10^{+187}:\\ \;\;\;\;\left(-y\right) \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \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 -2.5896956365151547 \cdot 10^{+187}:\\
\;\;\;\;\left(-y\right) \cdot \left(z \cdot x\right)\\

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


\end{array}
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
(FPCore (x y z)
 :precision binary64
 (if (<= (* y z) -2.5896956365151547e+187)
   (* (- y) (* z x))
   (- x (* (* y z) x))))
double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
double code(double x, double y, double z) {
	double tmp;
	if ((y * z) <= -2.5896956365151547e+187) {
		tmp = -y * (z * x);
	} else {
		tmp = x - ((y * z) * x);
	}
	return tmp;
}

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 (*.f64 y z) < -2.5896956365151547e187

    1. Initial program 11.5

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Applied add-cube-cbrt_binary6411.8

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

      \[\leadsto \color{blue}{\left(x \cdot \left(\sqrt[3]{1 - y \cdot z} \cdot \sqrt[3]{1 - y \cdot z}\right)\right) \cdot \sqrt[3]{1 - y \cdot z}} \]
    4. Taylor expanded in y around inf 0.6

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

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

    if -2.5896956365151547e187 < (*.f64 y z)

    1. Initial program 1.3

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Applied cancel-sign-sub-inv_binary641.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -2.5896956365151547 \cdot 10^{+187}:\\ \;\;\;\;\left(-y\right) \cdot \left(z \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \left(y \cdot z\right) \cdot x\\ \end{array} \]

Reproduce

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