Average Error: 3.5 → 0.1
Time: 5.6s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right) \]
\[\begin{array}{l} t_0 := -y \cdot \left(z \cdot x\right)\\ \mathbf{if}\;y \cdot z \leq -7.808746665337087 \cdot 10^{+272}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \cdot z \leq 2.5162389909062665 \cdot 10^{+283}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
x \cdot \left(1 - y \cdot z\right)
\begin{array}{l}
t_0 := -y \cdot \left(z \cdot x\right)\\
\mathbf{if}\;y \cdot z \leq -7.808746665337087 \cdot 10^{+272}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \cdot z \leq 2.5162389909062665 \cdot 10^{+283}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (* y (* z x)))))
   (if (<= (* y z) -7.808746665337087e+272)
     t_0
     (if (<= (* y z) 2.5162389909062665e+283) (* x (- 1.0 (* y z))) t_0))))
double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
double code(double x, double y, double z) {
	double t_0 = -(y * (z * x));
	double tmp;
	if ((y * z) <= -7.808746665337087e+272) {
		tmp = t_0;
	} else if ((y * z) <= 2.5162389909062665e+283) {
		tmp = x * (1.0 - (y * z));
	} else {
		tmp = t_0;
	}
	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) < -7.8087466653370868e272 or 2.51623899090626655e283 < (*.f64 y z)

    1. Initial program 49.9

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

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

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

    if -7.8087466653370868e272 < (*.f64 y z) < 2.51623899090626655e283

    1. Initial program 0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -7.808746665337087 \cdot 10^{+272}:\\ \;\;\;\;-y \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;y \cdot z \leq 2.5162389909062665 \cdot 10^{+283}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-y \cdot \left(z \cdot x\right)\\ \end{array} \]

Reproduce

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