Average Error: 3.5 → 0.2
Time: 2.5s
Precision: binary64
\[x \cdot \left(1 - y \cdot z\right)\]
\[\begin{array}{l} \mathbf{if}\;y \cdot z \leq -2.6603473447694313 \cdot 10^{+285} \lor \neg \left(y \cdot z \leq 1.0186609144118882 \cdot 10^{+218}\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 -2.6603473447694313 \cdot 10^{+285} \lor \neg \left(y \cdot z \leq 1.0186609144118882 \cdot 10^{+218}\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) -2.6603473447694313e+285)
         (not (<= (* y z) 1.0186609144118882e+218)))
   (- x (* z (* y x)))
   (- x (* (* y z) x))))
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 tmp;
	if (((((double) (y * z)) <= -2.6603473447694313e+285) || !(((double) (y * z)) <= 1.0186609144118882e+218))) {
		tmp = ((double) (x - ((double) (z * ((double) (y * x))))));
	} else {
		tmp = ((double) (x - ((double) (((double) (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.6603473447694313e285 or 1.01866091441188821e218 < (*.f64 y z)

    1. Initial program 38.1

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

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

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

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

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

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

    if -2.6603473447694313e285 < (*.f64 y z) < 1.01866091441188821e218

    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-lft-in_binary640.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -2.6603473447694313 \cdot 10^{+285} \lor \neg \left(y \cdot z \leq 1.0186609144118882 \cdot 10^{+218}\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 2020219 
(FPCore (x y z)
  :name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
  :precision binary64
  (* x (- 1.0 (* y z))))