Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A

Percentage Accurate: 68.6% → 99.8%
Time: 19.8s
Alternatives: 22
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 22 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 68.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{x}{x + y}}{x + \left(y + 1\right)} \cdot \frac{y}{x + y} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ (/ x (+ x y)) (+ x (+ y 1.0))) (/ y (+ x y))))
double code(double x, double y) {
	return ((x / (x + y)) / (x + (y + 1.0))) * (y / (x + y));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / (x + y)) / (x + (y + 1.0d0))) * (y / (x + y))
end function
public static double code(double x, double y) {
	return ((x / (x + y)) / (x + (y + 1.0))) * (y / (x + y));
}
def code(x, y):
	return ((x / (x + y)) / (x + (y + 1.0))) * (y / (x + y))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + Float64(y + 1.0))) * Float64(y / Float64(x + y)))
end
function tmp = code(x, y)
	tmp = ((x / (x + y)) / (x + (y + 1.0))) * (y / (x + y));
end
code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{x}{x + y}}{x + \left(y + 1\right)} \cdot \frac{y}{x + y}
\end{array}
Derivation
  1. Initial program 72.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Applied egg-rr0

    \[\leadsto expr\]
  5. Applied egg-rr0

    \[\leadsto expr\]
  6. Add Preprocessing

Alternative 2: 65.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\ t_1 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\ \mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-81}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+165}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 \cdot \left(x + \left(y + 1\right)\right)}}{x + y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 1.0 (/ x (* (+ x y) (+ (+ x y) 1.0)))))
        (t_1 (* (/ y (+ x y)) (/ 1.0 (+ x 1.0)))))
   (if (<= y 1.35e-111)
     t_1
     (if (<= y 1.02e-81)
       t_0
       (if (<= y 4.5e-42)
         t_1
         (if (<= y 1.3e+165)
           t_0
           (/ (/ x (* 1.0 (+ x (+ y 1.0)))) (+ x y))))))))
double code(double x, double y) {
	double t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	double t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 1.35e-111) {
		tmp = t_1;
	} else if (y <= 1.02e-81) {
		tmp = t_0;
	} else if (y <= 4.5e-42) {
		tmp = t_1;
	} else if (y <= 1.3e+165) {
		tmp = t_0;
	} else {
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 * (x / ((x + y) * ((x + y) + 1.0d0)))
    t_1 = (y / (x + y)) * (1.0d0 / (x + 1.0d0))
    if (y <= 1.35d-111) then
        tmp = t_1
    else if (y <= 1.02d-81) then
        tmp = t_0
    else if (y <= 4.5d-42) then
        tmp = t_1
    else if (y <= 1.3d+165) then
        tmp = t_0
    else
        tmp = (x / (1.0d0 * (x + (y + 1.0d0)))) / (x + y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	double t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 1.35e-111) {
		tmp = t_1;
	} else if (y <= 1.02e-81) {
		tmp = t_0;
	} else if (y <= 4.5e-42) {
		tmp = t_1;
	} else if (y <= 1.3e+165) {
		tmp = t_0;
	} else {
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)))
	t_1 = (y / (x + y)) * (1.0 / (x + 1.0))
	tmp = 0
	if y <= 1.35e-111:
		tmp = t_1
	elif y <= 1.02e-81:
		tmp = t_0
	elif y <= 4.5e-42:
		tmp = t_1
	elif y <= 1.3e+165:
		tmp = t_0
	else:
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y)
	return tmp
function code(x, y)
	t_0 = Float64(1.0 * Float64(x / Float64(Float64(x + y) * Float64(Float64(x + y) + 1.0))))
	t_1 = Float64(Float64(y / Float64(x + y)) * Float64(1.0 / Float64(x + 1.0)))
	tmp = 0.0
	if (y <= 1.35e-111)
		tmp = t_1;
	elseif (y <= 1.02e-81)
		tmp = t_0;
	elseif (y <= 4.5e-42)
		tmp = t_1;
	elseif (y <= 1.3e+165)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / Float64(1.0 * Float64(x + Float64(y + 1.0)))) / Float64(x + y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	tmp = 0.0;
	if (y <= 1.35e-111)
		tmp = t_1;
	elseif (y <= 1.02e-81)
		tmp = t_0;
	elseif (y <= 4.5e-42)
		tmp = t_1;
	elseif (y <= 1.3e+165)
		tmp = t_0;
	else
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 * N[(x / N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.35e-111], t$95$1, If[LessEqual[y, 1.02e-81], t$95$0, If[LessEqual[y, 4.5e-42], t$95$1, If[LessEqual[y, 1.3e+165], t$95$0, N[(N[(x / N[(1.0 * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\
t_1 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.02 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 \cdot \left(x + \left(y + 1\right)\right)}}{x + y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.34999999999999994e-111 or 1.01999999999999998e-81 < y < 4.5e-42

    1. Initial program 75.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 1.34999999999999994e-111 < y < 1.01999999999999998e-81 or 4.5e-42 < y < 1.3000000000000001e165

    1. Initial program 74.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 1.3000000000000001e165 < y

    1. Initial program 54.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 65.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\ t_1 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\ \mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-82}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{-42}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+165}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* 1.0 (/ x (* (+ x y) (+ (+ x y) 1.0)))))
        (t_1 (* (/ y (+ x y)) (/ 1.0 (+ x 1.0)))))
   (if (<= y 1.35e-111)
     t_1
     (if (<= y 9.2e-82)
       t_0
       (if (<= y 3.6e-42)
         t_1
         (if (<= y 2.05e+165) t_0 (* (/ x (+ x y)) (/ 1.0 y))))))))
double code(double x, double y) {
	double t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	double t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 1.35e-111) {
		tmp = t_1;
	} else if (y <= 9.2e-82) {
		tmp = t_0;
	} else if (y <= 3.6e-42) {
		tmp = t_1;
	} else if (y <= 2.05e+165) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) * (1.0 / y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 * (x / ((x + y) * ((x + y) + 1.0d0)))
    t_1 = (y / (x + y)) * (1.0d0 / (x + 1.0d0))
    if (y <= 1.35d-111) then
        tmp = t_1
    else if (y <= 9.2d-82) then
        tmp = t_0
    else if (y <= 3.6d-42) then
        tmp = t_1
    else if (y <= 2.05d+165) then
        tmp = t_0
    else
        tmp = (x / (x + y)) * (1.0d0 / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	double t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 1.35e-111) {
		tmp = t_1;
	} else if (y <= 9.2e-82) {
		tmp = t_0;
	} else if (y <= 3.6e-42) {
		tmp = t_1;
	} else if (y <= 2.05e+165) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) * (1.0 / y);
	}
	return tmp;
}
def code(x, y):
	t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)))
	t_1 = (y / (x + y)) * (1.0 / (x + 1.0))
	tmp = 0
	if y <= 1.35e-111:
		tmp = t_1
	elif y <= 9.2e-82:
		tmp = t_0
	elif y <= 3.6e-42:
		tmp = t_1
	elif y <= 2.05e+165:
		tmp = t_0
	else:
		tmp = (x / (x + y)) * (1.0 / y)
	return tmp
function code(x, y)
	t_0 = Float64(1.0 * Float64(x / Float64(Float64(x + y) * Float64(Float64(x + y) + 1.0))))
	t_1 = Float64(Float64(y / Float64(x + y)) * Float64(1.0 / Float64(x + 1.0)))
	tmp = 0.0
	if (y <= 1.35e-111)
		tmp = t_1;
	elseif (y <= 9.2e-82)
		tmp = t_0;
	elseif (y <= 3.6e-42)
		tmp = t_1;
	elseif (y <= 2.05e+165)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / Float64(x + y)) * Float64(1.0 / y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = 1.0 * (x / ((x + y) * ((x + y) + 1.0)));
	t_1 = (y / (x + y)) * (1.0 / (x + 1.0));
	tmp = 0.0;
	if (y <= 1.35e-111)
		tmp = t_1;
	elseif (y <= 9.2e-82)
		tmp = t_0;
	elseif (y <= 3.6e-42)
		tmp = t_1;
	elseif (y <= 2.05e+165)
		tmp = t_0;
	else
		tmp = (x / (x + y)) * (1.0 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(1.0 * N[(x / N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.35e-111], t$95$1, If[LessEqual[y, 9.2e-82], t$95$0, If[LessEqual[y, 3.6e-42], t$95$1, If[LessEqual[y, 2.05e+165], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\
t_1 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9.2 \cdot 10^{-82}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.34999999999999994e-111 or 9.19999999999999988e-82 < y < 3.6000000000000002e-42

    1. Initial program 75.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 1.34999999999999994e-111 < y < 9.19999999999999988e-82 or 3.6000000000000002e-42 < y < 2.0500000000000001e165

    1. Initial program 74.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 2.0500000000000001e165 < y

    1. Initial program 54.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 83.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\ \mathbf{elif}\;x \leq -1500000000000:\\ \;\;\;\;\frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y\\ \mathbf{elif}\;x \leq -3 \cdot 10^{-14}:\\ \;\;\;\;\frac{y}{\frac{x}{\frac{1}{x + 1}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -4e+166)
   (/ (/ y (+ x (+ y 1.0))) x)
   (if (<= x -1500000000000.0)
     (* (/ 1.0 (* (+ x y) (+ x y))) y)
     (if (<= x -3e-14)
       (/ y (/ x (/ 1.0 (+ x 1.0))))
       (* (/ y (+ x y)) (/ x (* (+ x y) (+ y 1.0))))))))
double code(double x, double y) {
	double tmp;
	if (x <= -4e+166) {
		tmp = (y / (x + (y + 1.0))) / x;
	} else if (x <= -1500000000000.0) {
		tmp = (1.0 / ((x + y) * (x + y))) * y;
	} else if (x <= -3e-14) {
		tmp = y / (x / (1.0 / (x + 1.0)));
	} else {
		tmp = (y / (x + y)) * (x / ((x + y) * (y + 1.0)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-4d+166)) then
        tmp = (y / (x + (y + 1.0d0))) / x
    else if (x <= (-1500000000000.0d0)) then
        tmp = (1.0d0 / ((x + y) * (x + y))) * y
    else if (x <= (-3d-14)) then
        tmp = y / (x / (1.0d0 / (x + 1.0d0)))
    else
        tmp = (y / (x + y)) * (x / ((x + y) * (y + 1.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -4e+166) {
		tmp = (y / (x + (y + 1.0))) / x;
	} else if (x <= -1500000000000.0) {
		tmp = (1.0 / ((x + y) * (x + y))) * y;
	} else if (x <= -3e-14) {
		tmp = y / (x / (1.0 / (x + 1.0)));
	} else {
		tmp = (y / (x + y)) * (x / ((x + y) * (y + 1.0)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -4e+166:
		tmp = (y / (x + (y + 1.0))) / x
	elif x <= -1500000000000.0:
		tmp = (1.0 / ((x + y) * (x + y))) * y
	elif x <= -3e-14:
		tmp = y / (x / (1.0 / (x + 1.0)))
	else:
		tmp = (y / (x + y)) * (x / ((x + y) * (y + 1.0)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -4e+166)
		tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / x);
	elseif (x <= -1500000000000.0)
		tmp = Float64(Float64(1.0 / Float64(Float64(x + y) * Float64(x + y))) * y);
	elseif (x <= -3e-14)
		tmp = Float64(y / Float64(x / Float64(1.0 / Float64(x + 1.0))));
	else
		tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(y + 1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4e+166)
		tmp = (y / (x + (y + 1.0))) / x;
	elseif (x <= -1500000000000.0)
		tmp = (1.0 / ((x + y) * (x + y))) * y;
	elseif (x <= -3e-14)
		tmp = y / (x / (1.0 / (x + 1.0)));
	else
		tmp = (y / (x + y)) * (x / ((x + y) * (y + 1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -4e+166], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1500000000000.0], N[(N[(1.0 / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, -3e-14], N[(y / N[(x / N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x}\\

\mathbf{elif}\;x \leq -1500000000000:\\
\;\;\;\;\frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y\\

\mathbf{elif}\;x \leq -3 \cdot 10^{-14}:\\
\;\;\;\;\frac{y}{\frac{x}{\frac{1}{x + 1}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(y + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.99999999999999976e166

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -3.99999999999999976e166 < x < -1.5e12

    1. Initial program 68.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
    7. Applied egg-rr0

      \[\leadsto expr\]

    if -1.5e12 < x < -2.9999999999999998e-14

    1. Initial program 99.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -2.9999999999999998e-14 < x

    1. Initial program 74.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 5: 62.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\ \mathbf{if}\;y \leq 8 \cdot 10^{-110}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (/ y (+ x y)) (/ 1.0 (+ x 1.0)))))
   (if (<= y 8e-110)
     t_0
     (if (<= y 4.9e-82)
       (/ x y)
       (if (<= y 3.5e-37) t_0 (/ (/ x (+ x y)) (+ y 1.0)))))))
double code(double x, double y) {
	double t_0 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 8e-110) {
		tmp = t_0;
	} else if (y <= 4.9e-82) {
		tmp = x / y;
	} else if (y <= 3.5e-37) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (y / (x + y)) * (1.0d0 / (x + 1.0d0))
    if (y <= 8d-110) then
        tmp = t_0
    else if (y <= 4.9d-82) then
        tmp = x / y
    else if (y <= 3.5d-37) then
        tmp = t_0
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y / (x + y)) * (1.0 / (x + 1.0));
	double tmp;
	if (y <= 8e-110) {
		tmp = t_0;
	} else if (y <= 4.9e-82) {
		tmp = x / y;
	} else if (y <= 3.5e-37) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = (y / (x + y)) * (1.0 / (x + 1.0))
	tmp = 0
	if y <= 8e-110:
		tmp = t_0
	elif y <= 4.9e-82:
		tmp = x / y
	elif y <= 3.5e-37:
		tmp = t_0
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y / Float64(x + y)) * Float64(1.0 / Float64(x + 1.0)))
	tmp = 0.0
	if (y <= 8e-110)
		tmp = t_0;
	elseif (y <= 4.9e-82)
		tmp = Float64(x / y);
	elseif (y <= 3.5e-37)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y / (x + y)) * (1.0 / (x + 1.0));
	tmp = 0.0;
	if (y <= 8e-110)
		tmp = t_0;
	elseif (y <= 4.9e-82)
		tmp = x / y;
	elseif (y <= 3.5e-37)
		tmp = t_0;
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8e-110], t$95$0, If[LessEqual[y, 4.9e-82], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.5e-37], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{x + y} \cdot \frac{1}{x + 1}\\
\mathbf{if}\;y \leq 8 \cdot 10^{-110}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 4.9 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 8.0000000000000004e-110 or 4.9000000000000003e-82 < y < 3.5000000000000001e-37

    1. Initial program 75.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]

    if 8.0000000000000004e-110 < y < 4.9000000000000003e-82

    1. Initial program 48.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.5000000000000001e-37 < y

    1. Initial program 68.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 55.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -2.6 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ y x) x)))
   (if (<= y -2.6e-129)
     t_0
     (if (<= y 3e-110)
       (/ y x)
       (if (<= y 3.9e-82) (/ x y) (if (<= y 3.1e-6) t_0 (/ (/ x y) y)))))))
double code(double x, double y) {
	double t_0 = (y / x) / x;
	double tmp;
	if (y <= -2.6e-129) {
		tmp = t_0;
	} else if (y <= 3e-110) {
		tmp = y / x;
	} else if (y <= 3.9e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (y / x) / x
    if (y <= (-2.6d-129)) then
        tmp = t_0
    else if (y <= 3d-110) then
        tmp = y / x
    else if (y <= 3.9d-82) then
        tmp = x / y
    else if (y <= 3.1d-6) then
        tmp = t_0
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y / x) / x;
	double tmp;
	if (y <= -2.6e-129) {
		tmp = t_0;
	} else if (y <= 3e-110) {
		tmp = y / x;
	} else if (y <= 3.9e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y / x) / x
	tmp = 0
	if y <= -2.6e-129:
		tmp = t_0
	elif y <= 3e-110:
		tmp = y / x
	elif y <= 3.9e-82:
		tmp = x / y
	elif y <= 3.1e-6:
		tmp = t_0
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y / x) / x)
	tmp = 0.0
	if (y <= -2.6e-129)
		tmp = t_0;
	elseif (y <= 3e-110)
		tmp = Float64(y / x);
	elseif (y <= 3.9e-82)
		tmp = Float64(x / y);
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y / x) / x;
	tmp = 0.0;
	if (y <= -2.6e-129)
		tmp = t_0;
	elseif (y <= 3e-110)
		tmp = y / x;
	elseif (y <= 3.9e-82)
		tmp = x / y;
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -2.6e-129], t$95$0, If[LessEqual[y, 3e-110], N[(y / x), $MachinePrecision], If[LessEqual[y, 3.9e-82], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.1e-6], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.6000000000000001e-129 or 3.89999999999999973e-82 < y < 3.1e-6

    1. Initial program 78.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -2.6000000000000001e-129 < y < 2.99999999999999986e-110

    1. Initial program 73.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 2.99999999999999986e-110 < y < 3.89999999999999973e-82

    1. Initial program 48.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.1e-6 < y

    1. Initial program 65.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 7: 55.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -2.8 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ y (* x x))))
   (if (<= y -2.8e-129)
     t_0
     (if (<= y 5.2e-111)
       (/ y x)
       (if (<= y 6.6e-82) (/ x y) (if (<= y 3.1e-6) t_0 (/ (/ x y) y)))))))
double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -2.8e-129) {
		tmp = t_0;
	} else if (y <= 5.2e-111) {
		tmp = y / x;
	} else if (y <= 6.6e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y / (x * x)
    if (y <= (-2.8d-129)) then
        tmp = t_0
    else if (y <= 5.2d-111) then
        tmp = y / x
    else if (y <= 6.6d-82) then
        tmp = x / y
    else if (y <= 3.1d-6) then
        tmp = t_0
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -2.8e-129) {
		tmp = t_0;
	} else if (y <= 5.2e-111) {
		tmp = y / x;
	} else if (y <= 6.6e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (x * x)
	tmp = 0
	if y <= -2.8e-129:
		tmp = t_0
	elif y <= 5.2e-111:
		tmp = y / x
	elif y <= 6.6e-82:
		tmp = x / y
	elif y <= 3.1e-6:
		tmp = t_0
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	t_0 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -2.8e-129)
		tmp = t_0;
	elseif (y <= 5.2e-111)
		tmp = Float64(y / x);
	elseif (y <= 6.6e-82)
		tmp = Float64(x / y);
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y / (x * x);
	tmp = 0.0;
	if (y <= -2.8e-129)
		tmp = t_0;
	elseif (y <= 5.2e-111)
		tmp = y / x;
	elseif (y <= 6.6e-82)
		tmp = x / y;
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e-129], t$95$0, If[LessEqual[y, 5.2e-111], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.6e-82], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.1e-6], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7999999999999999e-129 or 6.60000000000000045e-82 < y < 3.1e-6

    1. Initial program 78.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -2.7999999999999999e-129 < y < 5.19999999999999965e-111

    1. Initial program 73.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 5.19999999999999965e-111 < y < 6.60000000000000045e-82

    1. Initial program 48.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.1e-6 < y

    1. Initial program 65.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 8: 54.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{-129}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ y (* x x))))
   (if (<= y -2.7e-129)
     t_0
     (if (<= y 9e-110)
       (/ y x)
       (if (<= y 6.5e-82) (/ x y) (if (<= y 3.1e-6) t_0 (/ x (* y y))))))))
double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -2.7e-129) {
		tmp = t_0;
	} else if (y <= 9e-110) {
		tmp = y / x;
	} else if (y <= 6.5e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y / (x * x)
    if (y <= (-2.7d-129)) then
        tmp = t_0
    else if (y <= 9d-110) then
        tmp = y / x
    else if (y <= 6.5d-82) then
        tmp = x / y
    else if (y <= 3.1d-6) then
        tmp = t_0
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -2.7e-129) {
		tmp = t_0;
	} else if (y <= 9e-110) {
		tmp = y / x;
	} else if (y <= 6.5e-82) {
		tmp = x / y;
	} else if (y <= 3.1e-6) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (x * x)
	tmp = 0
	if y <= -2.7e-129:
		tmp = t_0
	elif y <= 9e-110:
		tmp = y / x
	elif y <= 6.5e-82:
		tmp = x / y
	elif y <= 3.1e-6:
		tmp = t_0
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	t_0 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -2.7e-129)
		tmp = t_0;
	elseif (y <= 9e-110)
		tmp = Float64(y / x);
	elseif (y <= 6.5e-82)
		tmp = Float64(x / y);
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y / (x * x);
	tmp = 0.0;
	if (y <= -2.7e-129)
		tmp = t_0;
	elseif (y <= 9e-110)
		tmp = y / x;
	elseif (y <= 6.5e-82)
		tmp = x / y;
	elseif (y <= 3.1e-6)
		tmp = t_0;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-129], t$95$0, If[LessEqual[y, 9e-110], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.5e-82], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.1e-6], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-129}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 9 \cdot 10^{-110}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 6.5 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.69999999999999999e-129 or 6.4999999999999997e-82 < y < 3.1e-6

    1. Initial program 78.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -2.69999999999999999e-129 < y < 9.0000000000000002e-110

    1. Initial program 73.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 9.0000000000000002e-110 < y < 6.4999999999999997e-82

    1. Initial program 48.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.1e-6 < y

    1. Initial program 65.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 4 regimes into one program.
  4. Add Preprocessing

Alternative 9: 62.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{if}\;y \leq 1.6 \cdot 10^{-109}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ y (+ x 1.0)) (+ x y))))
   (if (<= y 1.6e-109)
     t_0
     (if (<= y 3.2e-82)
       (/ x y)
       (if (<= y 3.5e-37) t_0 (/ (/ x (+ x y)) (+ y 1.0)))))))
double code(double x, double y) {
	double t_0 = (y / (x + 1.0)) / (x + y);
	double tmp;
	if (y <= 1.6e-109) {
		tmp = t_0;
	} else if (y <= 3.2e-82) {
		tmp = x / y;
	} else if (y <= 3.5e-37) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (y / (x + 1.0d0)) / (x + y)
    if (y <= 1.6d-109) then
        tmp = t_0
    else if (y <= 3.2d-82) then
        tmp = x / y
    else if (y <= 3.5d-37) then
        tmp = t_0
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y / (x + 1.0)) / (x + y);
	double tmp;
	if (y <= 1.6e-109) {
		tmp = t_0;
	} else if (y <= 3.2e-82) {
		tmp = x / y;
	} else if (y <= 3.5e-37) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = (y / (x + 1.0)) / (x + y)
	tmp = 0
	if y <= 1.6e-109:
		tmp = t_0
	elif y <= 3.2e-82:
		tmp = x / y
	elif y <= 3.5e-37:
		tmp = t_0
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y / Float64(x + 1.0)) / Float64(x + y))
	tmp = 0.0
	if (y <= 1.6e-109)
		tmp = t_0;
	elseif (y <= 3.2e-82)
		tmp = Float64(x / y);
	elseif (y <= 3.5e-37)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y / (x + 1.0)) / (x + y);
	tmp = 0.0;
	if (y <= 1.6e-109)
		tmp = t_0;
	elseif (y <= 3.2e-82)
		tmp = x / y;
	elseif (y <= 3.5e-37)
		tmp = t_0;
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.6e-109], t$95$0, If[LessEqual[y, 3.2e-82], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.5e-37], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x + 1}}{x + y}\\
\mathbf{if}\;y \leq 1.6 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-37}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.6000000000000001e-109 or 3.2000000000000001e-82 < y < 3.5000000000000001e-37

    1. Initial program 75.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 1.6000000000000001e-109 < y < 3.2000000000000001e-82

    1. Initial program 48.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.5000000000000001e-37 < y

    1. Initial program 68.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 10: 96.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9.8 \cdot 10^{+101}:\\ \;\;\;\;\frac{\frac{x}{\frac{x + y}{y} \cdot \left(x + y\right)}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -9.8e+101)
   (/ (/ x (* (/ (+ x y) y) (+ x y))) (+ x y))
   (* (/ y (+ x y)) (/ x (* (+ x y) (+ (+ x y) 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -9.8e+101) {
		tmp = (x / (((x + y) / y) * (x + y))) / (x + y);
	} else {
		tmp = (y / (x + y)) * (x / ((x + y) * ((x + y) + 1.0)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-9.8d+101)) then
        tmp = (x / (((x + y) / y) * (x + y))) / (x + y)
    else
        tmp = (y / (x + y)) * (x / ((x + y) * ((x + y) + 1.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -9.8e+101) {
		tmp = (x / (((x + y) / y) * (x + y))) / (x + y);
	} else {
		tmp = (y / (x + y)) * (x / ((x + y) * ((x + y) + 1.0)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -9.8e+101:
		tmp = (x / (((x + y) / y) * (x + y))) / (x + y)
	else:
		tmp = (y / (x + y)) * (x / ((x + y) * ((x + y) + 1.0)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -9.8e+101)
		tmp = Float64(Float64(x / Float64(Float64(Float64(x + y) / y) * Float64(x + y))) / Float64(x + y));
	else
		tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x + y) * Float64(Float64(x + y) + 1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -9.8e+101)
		tmp = (x / (((x + y) / y) * (x + y))) / (x + y);
	else
		tmp = (y / (x + y)) * (x / ((x + y) * ((x + y) + 1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -9.8e+101], N[(N[(x / N[(N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{+101}:\\
\;\;\;\;\frac{\frac{x}{\frac{x + y}{y} \cdot \left(x + y\right)}}{x + y}\\

\mathbf{else}:\\
\;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.79999999999999965e101

    1. Initial program 53.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -9.79999999999999965e101 < x

    1. Initial program 76.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 86.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x + y}{y}\\ \mathbf{if}\;y \leq 1:\\ \;\;\;\;\frac{\frac{x}{t\_0 \cdot \left(x + 1\right)}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t\_0 \cdot \left(x + y\right)}}{x + y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (+ x y) y)))
   (if (<= y 1.0)
     (/ (/ x (* t_0 (+ x 1.0))) (+ x y))
     (/ (/ x (* t_0 (+ x y))) (+ x y)))))
double code(double x, double y) {
	double t_0 = (x + y) / y;
	double tmp;
	if (y <= 1.0) {
		tmp = (x / (t_0 * (x + 1.0))) / (x + y);
	} else {
		tmp = (x / (t_0 * (x + y))) / (x + y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x + y) / y
    if (y <= 1.0d0) then
        tmp = (x / (t_0 * (x + 1.0d0))) / (x + y)
    else
        tmp = (x / (t_0 * (x + y))) / (x + y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x + y) / y;
	double tmp;
	if (y <= 1.0) {
		tmp = (x / (t_0 * (x + 1.0))) / (x + y);
	} else {
		tmp = (x / (t_0 * (x + y))) / (x + y);
	}
	return tmp;
}
def code(x, y):
	t_0 = (x + y) / y
	tmp = 0
	if y <= 1.0:
		tmp = (x / (t_0 * (x + 1.0))) / (x + y)
	else:
		tmp = (x / (t_0 * (x + y))) / (x + y)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x + y) / y)
	tmp = 0.0
	if (y <= 1.0)
		tmp = Float64(Float64(x / Float64(t_0 * Float64(x + 1.0))) / Float64(x + y));
	else
		tmp = Float64(Float64(x / Float64(t_0 * Float64(x + y))) / Float64(x + y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x + y) / y;
	tmp = 0.0;
	if (y <= 1.0)
		tmp = (x / (t_0 * (x + 1.0))) / (x + y);
	else
		tmp = (x / (t_0 * (x + y))) / (x + y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(N[(x / N[(t$95$0 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(t$95$0 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x + y}{y}\\
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{\frac{x}{t\_0 \cdot \left(x + 1\right)}}{x + y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t\_0 \cdot \left(x + y\right)}}{x + y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 1 < y

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 81.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.1 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{x}{\frac{x + y}{y} \cdot \left(x + 1\right)}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 \cdot \left(x + \left(y + 1\right)\right)}}{x + y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 3.1e-6)
   (/ (/ x (* (/ (+ x y) y) (+ x 1.0))) (+ x y))
   (/ (/ x (* 1.0 (+ x (+ y 1.0)))) (+ x y))))
double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-6) {
		tmp = (x / (((x + y) / y) * (x + 1.0))) / (x + y);
	} else {
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 3.1d-6) then
        tmp = (x / (((x + y) / y) * (x + 1.0d0))) / (x + y)
    else
        tmp = (x / (1.0d0 * (x + (y + 1.0d0)))) / (x + y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-6) {
		tmp = (x / (((x + y) / y) * (x + 1.0))) / (x + y);
	} else {
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 3.1e-6:
		tmp = (x / (((x + y) / y) * (x + 1.0))) / (x + y)
	else:
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 3.1e-6)
		tmp = Float64(Float64(x / Float64(Float64(Float64(x + y) / y) * Float64(x + 1.0))) / Float64(x + y));
	else
		tmp = Float64(Float64(x / Float64(1.0 * Float64(x + Float64(y + 1.0)))) / Float64(x + y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3.1e-6)
		tmp = (x / (((x + y) / y) * (x + 1.0))) / (x + y);
	else
		tmp = (x / (1.0 * (x + (y + 1.0)))) / (x + y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 3.1e-6], N[(N[(x / N[(N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 * N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{x}{\frac{x + y}{y} \cdot \left(x + 1\right)}}{x + y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{1 \cdot \left(x + \left(y + 1\right)\right)}}{x + y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.1e-6

    1. Initial program 75.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 3.1e-6 < y

    1. Initial program 65.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 58.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -3.9e+166)
   (/ (/ y x) (+ x y))
   (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ (/ x (+ x y)) (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= -3.9e+166) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-3.9d+166)) then
        tmp = (y / x) / (x + y)
    else if (x <= (-8d-184)) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -3.9e+166) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -3.9e+166:
		tmp = (y / x) / (x + y)
	elif x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -3.9e+166)
		tmp = Float64(Float64(y / x) / Float64(x + y));
	elseif (x <= -8e-184)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -3.9e+166)
		tmp = (y / x) / (x + y);
	elseif (x <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -3.9e+166], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-184], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.89999999999999991e166

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -3.89999999999999991e166 < x < -8.0000000000000005e-184

    1. Initial program 79.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
    6. Applied egg-rr0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 14: 58.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -5.2e+166)
   (/ (/ y x) (+ x y))
   (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= -5.2e+166) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-5.2d+166)) then
        tmp = (y / x) / (x + y)
    else if (x <= (-8d-184)) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -5.2e+166) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -5.2e+166:
		tmp = (y / x) / (x + y)
	elif x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -5.2e+166)
		tmp = Float64(Float64(y / x) / Float64(x + y));
	elseif (x <= -8e-184)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -5.2e+166)
		tmp = (y / x) / (x + y);
	elseif (x <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -5.2e+166], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-184], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.1999999999999999e166

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -5.1999999999999999e166 < x < -8.0000000000000005e-184

    1. Initial program 79.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 15: 58.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -3.9e+166)
   (/ (/ y x) x)
   (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= -3.9e+166) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-3.9d+166)) then
        tmp = (y / x) / x
    else if (x <= (-8d-184)) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -3.9e+166) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -3.9e+166:
		tmp = (y / x) / x
	elif x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -3.9e+166)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -8e-184)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -3.9e+166)
		tmp = (y / x) / x;
	elseif (x <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -3.9e+166], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -8e-184], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.9 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.89999999999999991e166

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -3.89999999999999991e166 < x < -8.0000000000000005e-184

    1. Initial program 79.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    5. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 57.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -5.8e+166)
   (/ (/ y x) x)
   (if (<= x -8e-184) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -5.8e+166) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-5.8d+166)) then
        tmp = (y / x) / x
    else if (x <= (-8d-184)) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = x / (y * (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -5.8e+166) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -5.8e+166:
		tmp = (y / x) / x
	elif x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = x / (y * (y + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -5.8e+166)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -8e-184)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -5.8e+166)
		tmp = (y / x) / x;
	elseif (x <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = x / (y * (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -5.8e+166], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -8e-184], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.8000000000000003e166

    1. Initial program 57.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -5.8000000000000003e166 < x < -8.0000000000000005e-184

    1. Initial program 79.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 57.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -1.0)
   (/ (/ y x) x)
   (if (<= x -8e-184) (/ y (+ x y)) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x + y);
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.0d0)) then
        tmp = (y / x) / x
    else if (x <= (-8d-184)) then
        tmp = y / (x + y)
    else
        tmp = x / (y * (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = (y / x) / x;
	} else if (x <= -8e-184) {
		tmp = y / (x + y);
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.0:
		tmp = (y / x) / x
	elif x <= -8e-184:
		tmp = y / (x + y)
	else:
		tmp = x / (y * (y + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.0)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -8e-184)
		tmp = Float64(y / Float64(x + y));
	else
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.0)
		tmp = (y / x) / x;
	elseif (x <= -8e-184)
		tmp = y / (x + y);
	else
		tmp = x / (y * (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -8e-184], N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x + y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Applied egg-rr0

      \[\leadsto expr\]

    if -1 < x < -8.0000000000000005e-184

    1. Initial program 86.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr0

      \[\leadsto expr\]
    4. Applied egg-rr0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
    7. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    8. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 18: 44.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.25 \cdot 10^{-111}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 1.25e-111) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
double code(double x, double y) {
	double tmp;
	if (y <= 1.25e-111) {
		tmp = y / x;
	} else if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.25d-111) then
        tmp = y / x
    else if (y <= 1.0d0) then
        tmp = x / y
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.25e-111) {
		tmp = y / x;
	} else if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 1.25e-111:
		tmp = y / x
	elif y <= 1.0:
		tmp = x / y
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 1.25e-111)
		tmp = Float64(y / x);
	elseif (y <= 1.0)
		tmp = Float64(x / y);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.25e-111)
		tmp = y / x;
	elseif (y <= 1.0)
		tmp = x / y;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 1.25e-111], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.25 \cdot 10^{-111}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.2500000000000001e-111

    1. Initial program 74.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 1.2500000000000001e-111 < y < 1

    1. Initial program 83.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if 1 < y

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 19: 32.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x -8e-184) (/ y x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (x <= -8e-184) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-8d-184)) then
        tmp = y / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -8e-184) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -8e-184:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -8e-184)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -8e-184)
		tmp = y / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -8e-184], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.0000000000000005e-184

    1. Initial program 72.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 0

      \[\leadsto expr\]
    4. Simplified0

      \[\leadsto expr\]
    5. Taylor expanded in y around 0 0

      \[\leadsto expr\]
    6. Simplified0

      \[\leadsto expr\]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 26.1% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
	return x / y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / y
end function
public static double code(double x, double y) {
	return x / y;
}
def code(x, y):
	return x / y
function code(x, y)
	return Float64(x / y)
end
function tmp = code(x, y)
	tmp = x / y;
end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 72.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Taylor expanded in y around 0 0

    \[\leadsto expr\]
  6. Simplified0

    \[\leadsto expr\]
  7. Add Preprocessing

Alternative 21: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
	return 1.0 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
public static double code(double x, double y) {
	return 1.0 / x;
}
def code(x, y):
	return 1.0 / x
function code(x, y)
	return Float64(1.0 / x)
end
function tmp = code(x, y)
	tmp = 1.0 / x;
end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 72.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 0

    \[\leadsto expr\]
  4. Simplified0

    \[\leadsto expr\]
  5. Taylor expanded in y around inf 0

    \[\leadsto expr\]
  6. Simplified0

    \[\leadsto expr\]
  7. Add Preprocessing

Alternative 22: 3.5% accurate, 17.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 72.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr0

    \[\leadsto expr\]
  4. Taylor expanded in x around 0 0

    \[\leadsto expr\]
  5. Simplified0

    \[\leadsto expr\]
  6. Taylor expanded in y around 0 0

    \[\leadsto expr\]
  7. Simplified0

    \[\leadsto expr\]
  8. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y):
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
end
function tmp = code(x, y)
	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}

Reproduce

?
herbie shell --seed 2024110 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))