Average Error: 3.3 → 0.4
Time: 5.2s
Precision: binary64
\[[y, z] = \mathsf{sort}([y, z]) \\]
\[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 -1.257058379857181 \cdot 10^{+243}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \cdot z \leq 2.952490036847228 \cdot 10^{+151}:\\ \;\;\;\;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) -1.257058379857181e+243)
     t_0
     (if (<= (* y z) 2.952490036847228e+151) (* 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) <= -1.257058379857181e+243) {
		tmp = t_0;
	} else if ((y * z) <= 2.952490036847228e+151) {
		tmp = x * (1.0 - (y * z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = x * (1.0d0 - (y * z))
end function
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(y * (z * x))
    if ((y * z) <= (-1.257058379857181d+243)) then
        tmp = t_0
    else if ((y * z) <= 2.952490036847228d+151) then
        tmp = x * (1.0d0 - (y * z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	return x * (1.0 - (y * z));
}
public static double code(double x, double y, double z) {
	double t_0 = -(y * (z * x));
	double tmp;
	if ((y * z) <= -1.257058379857181e+243) {
		tmp = t_0;
	} else if ((y * z) <= 2.952490036847228e+151) {
		tmp = x * (1.0 - (y * z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	return x * (1.0 - (y * z))
def code(x, y, z):
	t_0 = -(y * (z * x))
	tmp = 0
	if (y * z) <= -1.257058379857181e+243:
		tmp = t_0
	elif (y * z) <= 2.952490036847228e+151:
		tmp = x * (1.0 - (y * z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	return Float64(x * Float64(1.0 - Float64(y * z)))
end
function code(x, y, z)
	t_0 = Float64(-Float64(y * Float64(z * x)))
	tmp = 0.0
	if (Float64(y * z) <= -1.257058379857181e+243)
		tmp = t_0;
	elseif (Float64(y * z) <= 2.952490036847228e+151)
		tmp = Float64(x * Float64(1.0 - Float64(y * z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp = code(x, y, z)
	tmp = x * (1.0 - (y * z));
end
function tmp_2 = code(x, y, z)
	t_0 = -(y * (z * x));
	tmp = 0.0;
	if ((y * z) <= -1.257058379857181e+243)
		tmp = t_0;
	elseif ((y * z) <= 2.952490036847228e+151)
		tmp = x * (1.0 - (y * z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = (-N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[N[(y * z), $MachinePrecision], -1.257058379857181e+243], t$95$0, If[LessEqual[N[(y * z), $MachinePrecision], 2.952490036847228e+151], N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
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 -1.257058379857181 \cdot 10^{+243}:\\
\;\;\;\;t_0\\

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

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


\end{array}

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) < -1.2570583798571811e243 or 2.9524900368472281e151 < (*.f64 y z)

    1. Initial program 23.0

      \[x \cdot \left(1 - y \cdot z\right) \]
    2. Applied egg-rr23.6

      \[\leadsto \color{blue}{{\left(\sqrt[3]{x \cdot \left(1 - y \cdot z\right)}\right)}^{3}} \]
    3. Applied egg-rr23.6

      \[\leadsto \color{blue}{{\left(\sqrt[3]{1 - y \cdot z}\right)}^{2} \cdot \left(\sqrt[3]{1 - y \cdot z} \cdot x\right)} \]
    4. Applied egg-rr23.8

      \[\leadsto {\left(\sqrt[3]{1 - y \cdot z}\right)}^{2} \cdot \left(\color{blue}{{\left(\sqrt[3]{\sqrt[3]{1 - y \cdot z}}\right)}^{3}} \cdot x\right) \]
    5. Taylor expanded in y around inf 2.2

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

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

    if -1.2570583798571811e243 < (*.f64 y z) < 2.9524900368472281e151

    1. Initial program 0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot z \leq -1.257058379857181 \cdot 10^{+243}:\\ \;\;\;\;-y \cdot \left(z \cdot x\right)\\ \mathbf{elif}\;y \cdot z \leq 2.952490036847228 \cdot 10^{+151}:\\ \;\;\;\;x \cdot \left(1 - y \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;-y \cdot \left(z \cdot x\right)\\ \end{array} \]

Reproduce

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