Average Error: 2.5 → 1.3
Time: 7.8s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right) \]
\[\begin{array}{l} \mathbf{if}\;x \leq -1.5833889410078922 \cdot 10^{-22} \lor \neg \left(x \leq 1.5506037414681654 \cdot 10^{+35}\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \left(x \cdot z\right)\\ \end{array} \]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
\mathbf{if}\;x \leq -1.5833889410078922 \cdot 10^{-22} \lor \neg \left(x \leq 1.5506037414681654 \cdot 10^{+35}\right):\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\

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


\end{array}
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -1.5833889410078922e-22) (not (<= x 1.5506037414681654e+35)))
   (* x (- 1.0 (* y z)))
   (- x (* y (* x z)))))
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 ((x <= -1.5833889410078922e-22) || !(x <= 1.5506037414681654e+35)) {
		tmp = x * (1.0 - (y * z));
	} else {
		tmp = x - (y * (x * z));
	}
	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 x < -1.5833889410078922e-22 or 1.5506037414681654e35 < x

    1. Initial program 0.1

      \[x \cdot \left(1 - y \cdot z\right) \]

    if -1.5833889410078922e-22 < x < 1.5506037414681654e35

    1. Initial program 4.9

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Taylor expanded in y around 0 2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5833889410078922 \cdot 10^{-22} \lor \neg \left(x \leq 1.5506037414681654 \cdot 10^{+35}\right):\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot \left(x \cdot z\right)\\ \end{array} \]

Reproduce

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