Average Error: 3.4 → 2.0
Time: 3.6s
Precision: binary64
\[[y, z] = \mathsf{sort}([y, z]) \\]
\[x \cdot \left(1 - y \cdot z\right) \]
\[\begin{array}{l} \mathbf{if}\;y \leq -4.934776551119867 \cdot 10^{+222}:\\ \;\;\;\;x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x \cdot \left(\sqrt[3]{y} \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 2.617901184839269 \cdot 10^{-75}:\\ \;\;\;\;x - x \cdot \left(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}\;y \leq -4.934776551119867 \cdot 10^{+222}:\\
\;\;\;\;x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x \cdot \left(\sqrt[3]{y} \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 2.617901184839269 \cdot 10^{-75}:\\
\;\;\;\;x - x \cdot \left(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 (<= y -4.934776551119867e+222)
   (- x (* (* (cbrt y) (cbrt y)) (* x (* (cbrt y) z))))
   (if (<= y 2.617901184839269e-75) (- x (* x (* 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 (y <= -4.934776551119867e+222) {
		tmp = x - ((cbrt(y) * cbrt(y)) * (x * (cbrt(y) * z)));
	} else if (y <= 2.617901184839269e-75) {
		tmp = x - (x * (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 3 regimes
  2. if y < -4.9347765511198672e222

    1. Initial program 13.4

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

      \[\leadsto \color{blue}{x - y \cdot \left(z \cdot x\right)} \]
    3. Applied add-cube-cbrt_binary6410.4

      \[\leadsto x - \color{blue}{\left(\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}\right)} \cdot \left(z \cdot x\right) \]
    4. Applied associate-*l*_binary6410.4

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

      \[\leadsto x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \color{blue}{\left(\left(\sqrt[3]{y} \cdot z\right) \cdot x\right)} \]
    6. Simplified6.7

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

    if -4.9347765511198672e222 < y < 2.6179011848392689e-75

    1. Initial program 1.4

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

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

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

    if 2.6179011848392689e-75 < y

    1. Initial program 12.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.934776551119867 \cdot 10^{+222}:\\ \;\;\;\;x - \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(x \cdot \left(\sqrt[3]{y} \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 2.617901184839269 \cdot 10^{-75}:\\ \;\;\;\;x - x \cdot \left(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))))