Average Error: 3.1 → 0.1
Time: 2.4s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -\infty \lor \neg \left(y \cdot z \leq 3.1115452180225445 \cdot 10^{+275}\right):\\ \;\;\;\;x - z \cdot \left(y \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 -\infty \lor \neg \left(y \cdot z \leq 3.1115452180225445 \cdot 10^{+275}\right):\\
\;\;\;\;x - z \cdot \left(y \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 (or (<= (* y z) (- INFINITY)) (not (<= (* y z) 3.1115452180225445e+275)))
   (- x (* z (* y 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) <= -((double) INFINITY)) || !((y * z) <= 3.1115452180225445e+275)) {
		tmp = x - (z * (y * 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) < -inf.0 or 3.11154521802254453e275 < (*.f64 y z)

    1. Initial program 54.4

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

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

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

      \[\leadsto \color{blue}{x} + \left(-y \cdot z\right) \cdot x\]
    6. Simplified54.4

      \[\leadsto x + \color{blue}{x \cdot \left(-y \cdot z\right)}\]
    7. Using strategy rm
    8. Applied distribute-rgt-neg-in_binary6454.4

      \[\leadsto x + x \cdot \color{blue}{\left(y \cdot \left(-z\right)\right)}\]
    9. Applied associate-*r*_binary640.3

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

    if -inf.0 < (*.f64 y z) < 3.11154521802254453e275

    1. Initial program 0.1

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot \left(-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 -\infty \lor \neg \left(y \cdot z \leq 3.1115452180225445 \cdot 10^{+275}\right):\\ \;\;\;\;x - z \cdot \left(y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;x - \left(y \cdot z\right) \cdot x\\ \end{array}\]

Reproduce

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