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

Percentage Accurate: 70.1% → 99.8%
Time: 17.4s
Alternatives: 20
Speedup: 1.3×

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 20 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: 70.1% 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} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{y}{x + \left(y + 1\right)}}{y + x} \cdot \frac{x}{y + x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (* (/ (/ y (+ x (+ y 1.0))) (+ y x)) (/ x (+ y x))))
assert(x < y);
double code(double x, double y) {
	return ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((y / (x + (y + 1.0d0))) / (y + x)) * (x / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
	return ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x));
}
[x, y] = sort([x, y])
def code(x, y):
	return ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x))
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(y + x)) * Float64(x / Float64(y + x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = ((y / (x + (y + 1.0))) / (y + x)) * (x / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{x + \left(y + 1\right)}}{y + x} \cdot \frac{x}{y + x}
\end{array}
Derivation
  1. Initial program 68.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. Step-by-step derivation
    1. times-frac85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. associate-+r+85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. associate-*l/80.6%

      \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    4. times-frac99.8%

      \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
    5. *-commutative99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
  3. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
  4. Final simplification99.8%

    \[\leadsto \frac{\frac{y}{x + \left(y + 1\right)}}{y + x} \cdot \frac{x}{y + x} \]

Alternative 2: 96.7% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+172}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ y x))))
   (if (<= x -5.2e+172)
     (* t_0 (/ (/ y x) (+ y x)))
     (if (<= x -8.5e-21)
       (* (/ y (+ x (+ y 1.0))) (/ x (* (+ y x) (+ y x))))
       (* t_0 (/ (/ y (+ y 1.0)) (+ y x)))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -5.2e+172) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -8.5e-21) {
		tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
	} else {
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + x)
    if (x <= (-5.2d+172)) then
        tmp = t_0 * ((y / x) / (y + x))
    else if (x <= (-8.5d-21)) then
        tmp = (y / (x + (y + 1.0d0))) * (x / ((y + x) * (y + x)))
    else
        tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -5.2e+172) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -8.5e-21) {
		tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
	} else {
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + x)
	tmp = 0
	if x <= -5.2e+172:
		tmp = t_0 * ((y / x) / (y + x))
	elif x <= -8.5e-21:
		tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)))
	else:
		tmp = t_0 * ((y / (y + 1.0)) / (y + x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + x))
	tmp = 0.0
	if (x <= -5.2e+172)
		tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x)));
	elseif (x <= -8.5e-21)
		tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(y + x) * Float64(y + x))));
	else
		tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + x);
	tmp = 0.0;
	if (x <= -5.2e+172)
		tmp = t_0 * ((y / x) / (y + x));
	elseif (x <= -8.5e-21)
		tmp = (y / (x + (y + 1.0))) * (x / ((y + x) * (y + x)));
	else
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+172], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-21], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+172}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\

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

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


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

    1. Initial program 62.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. Step-by-step derivation
      1. times-frac80.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+80.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/80.0%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 99.7%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{x + y} \]

    if -5.2e172 < x < -8.4999999999999993e-21

    1. Initial program 67.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. Step-by-step derivation
      1. times-frac90.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity90.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+90.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.1%

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

    if -8.4999999999999993e-21 < x

    1. Initial program 69.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. Step-by-step derivation
      1. times-frac85.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+85.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/78.8%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around 0 84.7%

      \[\leadsto \frac{\color{blue}{\frac{y}{1 + y}}}{x + y} \cdot \frac{x}{x + y} \]
    5. Step-by-step derivation
      1. +-commutative77.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified84.7%

      \[\leadsto \frac{\color{blue}{\frac{y}{y + 1}}}{x + y} \cdot \frac{x}{x + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+172}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{y + 1}}{y + x}\\ \end{array} \]

Alternative 3: 89.0% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{+14}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-166}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + \left(x + 1\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ y x))))
   (if (<= x -2.2e+14)
     (* t_0 (/ (/ y x) (+ y x)))
     (if (<= x -8.5e-166)
       (* (/ x (* (+ y x) (+ y x))) (/ y (+ y 1.0)))
       (/ t_0 (+ y (+ x 1.0)))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -2.2e+14) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -8.5e-166) {
		tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
	} else {
		tmp = t_0 / (y + (x + 1.0));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + x)
    if (x <= (-2.2d+14)) then
        tmp = t_0 * ((y / x) / (y + x))
    else if (x <= (-8.5d-166)) then
        tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0d0))
    else
        tmp = t_0 / (y + (x + 1.0d0))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -2.2e+14) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -8.5e-166) {
		tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
	} else {
		tmp = t_0 / (y + (x + 1.0));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + x)
	tmp = 0
	if x <= -2.2e+14:
		tmp = t_0 * ((y / x) / (y + x))
	elif x <= -8.5e-166:
		tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0))
	else:
		tmp = t_0 / (y + (x + 1.0))
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + x))
	tmp = 0.0
	if (x <= -2.2e+14)
		tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x)));
	elseif (x <= -8.5e-166)
		tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(y + 1.0)));
	else
		tmp = Float64(t_0 / Float64(y + Float64(x + 1.0)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + x);
	tmp = 0.0;
	if (x <= -2.2e+14)
		tmp = t_0 * ((y / x) / (y + x));
	elseif (x <= -8.5e-166)
		tmp = (x / ((y + x) * (y + x))) * (y / (y + 1.0));
	else
		tmp = t_0 / (y + (x + 1.0));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+14], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-166], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 85.5%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{x + y} \]

    if -2.2e14 < x < -8.5e-166

    1. Initial program 82.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. Step-by-step derivation
      1. times-frac97.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity97.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity97.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+97.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified97.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 96.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative96.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified96.1%

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

    if -8.5e-166 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac83.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative83.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/83.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative83.0%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative83.0%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative83.0%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/70.8%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.1%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.1%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.1%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.1%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.1%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.1%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 59.3%

      \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-166}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{y + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 4: 81.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ t_1 := \frac{\frac{y}{x}}{t_0}\\ \mathbf{if}\;x \leq -8.8 \cdot 10^{+15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{t_0}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ (/ y x) t_0)))
   (if (<= x -8.8e+15)
     t_1
     (if (<= x -5.2e-25)
       (/ x (* (+ y 1.0) (+ y x)))
       (if (<= x -1e-134) t_1 (/ (/ x (+ y x)) t_0))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / x) / t_0;
	double tmp;
	if (x <= -8.8e+15) {
		tmp = t_1;
	} else if (x <= -5.2e-25) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / (y + x)) / t_0;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y + (x + 1.0d0)
    t_1 = (y / x) / t_0
    if (x <= (-8.8d+15)) then
        tmp = t_1
    else if (x <= (-5.2d-25)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = t_1
    else
        tmp = (x / (y + x)) / t_0
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / x) / t_0;
	double tmp;
	if (x <= -8.8e+15) {
		tmp = t_1;
	} else if (x <= -5.2e-25) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / (y + x)) / t_0;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	t_1 = (y / x) / t_0
	tmp = 0
	if x <= -8.8e+15:
		tmp = t_1
	elif x <= -5.2e-25:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = t_1
	else:
		tmp = (x / (y + x)) / t_0
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	t_1 = Float64(Float64(y / x) / t_0)
	tmp = 0.0
	if (x <= -8.8e+15)
		tmp = t_1;
	elseif (x <= -5.2e-25)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / Float64(y + x)) / t_0);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y + (x + 1.0);
	t_1 = (y / x) / t_0;
	tmp = 0.0;
	if (x <= -8.8e+15)
		tmp = t_1;
	elseif (x <= -5.2e-25)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = (x / (y + x)) / t_0;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -8.8e+15], t$95$1, If[LessEqual[x, -5.2e-25], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t_0}\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+15}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.8e15 or -5.2e-25 < x < -1.00000000000000004e-134

    1. Initial program 71.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. Step-by-step derivation
      1. times-frac89.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/89.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative89.1%

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

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

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/76.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*80.6%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative80.6%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified80.6%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
      2. div-inv99.7%

        \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{1}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x \cdot \frac{1}{\color{blue}{\frac{1}{\frac{y}{x + y}}}}}{x + y}}{y + \left(x + 1\right)} \]
      4. remove-double-div99.9%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\frac{y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
    5. Applied egg-rr99.9%

      \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
    6. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x \cdot y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
      2. associate-/l*99.8%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
    7. Simplified99.8%

      \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
    8. Taylor expanded in x around inf 70.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + \left(x + 1\right)} \]

    if -8.8e15 < x < -5.2e-25

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/82.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative82.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/71.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.3%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.3%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 60.0%

      \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 5: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ t_1 := \frac{\frac{y}{y + x}}{t_0}\\ \mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{t_0}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ (/ y (+ y x)) t_0)))
   (if (<= x -1.25e+14)
     t_1
     (if (<= x -1.15e-26)
       (/ x (* (+ y 1.0) (+ y x)))
       (if (<= x -1e-134) t_1 (/ (/ x (+ y x)) t_0))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / (y + x)) / t_0;
	double tmp;
	if (x <= -1.25e+14) {
		tmp = t_1;
	} else if (x <= -1.15e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / (y + x)) / t_0;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y + (x + 1.0d0)
    t_1 = (y / (y + x)) / t_0
    if (x <= (-1.25d+14)) then
        tmp = t_1
    else if (x <= (-1.15d-26)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = t_1
    else
        tmp = (x / (y + x)) / t_0
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / (y + x)) / t_0;
	double tmp;
	if (x <= -1.25e+14) {
		tmp = t_1;
	} else if (x <= -1.15e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / (y + x)) / t_0;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	t_1 = (y / (y + x)) / t_0
	tmp = 0
	if x <= -1.25e+14:
		tmp = t_1
	elif x <= -1.15e-26:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = t_1
	else:
		tmp = (x / (y + x)) / t_0
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	t_1 = Float64(Float64(y / Float64(y + x)) / t_0)
	tmp = 0.0
	if (x <= -1.25e+14)
		tmp = t_1;
	elseif (x <= -1.15e-26)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / Float64(y + x)) / t_0);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y + (x + 1.0);
	t_1 = (y / (y + x)) / t_0;
	tmp = 0.0;
	if (x <= -1.25e+14)
		tmp = t_1;
	elseif (x <= -1.15e-26)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = (x / (y + x)) / t_0;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -1.25e+14], t$95$1, If[LessEqual[x, -1.15e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{\frac{y}{y + x}}{t_0}\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.25e14 or -1.15000000000000004e-26 < x < -1.00000000000000004e-134

    1. Initial program 71.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. Step-by-step derivation
      1. times-frac89.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/89.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative89.1%

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

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

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/76.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*80.6%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative80.6%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified80.6%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around inf 71.3%

      \[\leadsto \frac{\frac{\color{blue}{y}}{x + y}}{y + \left(x + 1\right)} \]

    if -1.25e14 < x < -1.15000000000000004e-26

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/82.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative82.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/71.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.3%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.3%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 60.0%

      \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{y + \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{y + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 6: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ t_1 := y + \left(x + 1\right)\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{+14}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{t_1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ y x))) (t_1 (+ y (+ x 1.0))))
   (if (<= x -1.6e+14)
     (* t_0 (/ (/ y x) (+ y x)))
     (if (<= x -1.7e-24)
       (/ x (* (+ y 1.0) (+ y x)))
       (if (<= x -1e-134) (/ (/ y (+ y x)) t_1) (/ t_0 t_1))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + x);
	double t_1 = y + (x + 1.0);
	double tmp;
	if (x <= -1.6e+14) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -1.7e-24) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = (y / (y + x)) / t_1;
	} else {
		tmp = t_0 / t_1;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = x / (y + x)
    t_1 = y + (x + 1.0d0)
    if (x <= (-1.6d+14)) then
        tmp = t_0 * ((y / x) / (y + x))
    else if (x <= (-1.7d-24)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = (y / (y + x)) / t_1
    else
        tmp = t_0 / t_1
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + x);
	double t_1 = y + (x + 1.0);
	double tmp;
	if (x <= -1.6e+14) {
		tmp = t_0 * ((y / x) / (y + x));
	} else if (x <= -1.7e-24) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = (y / (y + x)) / t_1;
	} else {
		tmp = t_0 / t_1;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + x)
	t_1 = y + (x + 1.0)
	tmp = 0
	if x <= -1.6e+14:
		tmp = t_0 * ((y / x) / (y + x))
	elif x <= -1.7e-24:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = (y / (y + x)) / t_1
	else:
		tmp = t_0 / t_1
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + x))
	t_1 = Float64(y + Float64(x + 1.0))
	tmp = 0.0
	if (x <= -1.6e+14)
		tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x)));
	elseif (x <= -1.7e-24)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = Float64(Float64(y / Float64(y + x)) / t_1);
	else
		tmp = Float64(t_0 / t_1);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + x);
	t_1 = y + (x + 1.0);
	tmp = 0.0;
	if (x <= -1.6e+14)
		tmp = t_0 * ((y / x) / (y + x));
	elseif (x <= -1.7e-24)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = (y / (y + x)) / t_1;
	else
		tmp = t_0 / t_1;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+14], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-24], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(t$95$0 / t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
t_1 := y + \left(x + 1\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 85.5%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{x + y} \]

    if -1.6e14 < x < -1.69999999999999996e-24

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -1.69999999999999996e-24 < x < -1.00000000000000004e-134

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/99.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative99.5%

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

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative99.5%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/89.0%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*89.2%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative89.2%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative89.2%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative89.2%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+89.2%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified89.2%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around inf 46.1%

      \[\leadsto \frac{\frac{\color{blue}{y}}{x + y}}{y + \left(x + 1\right)} \]

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/82.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative82.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/71.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.3%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.3%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 60.0%

      \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{y + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 7: 87.4% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(1 + \left(y + x \cdot 2\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= y 2.2e-183)
   (/ (/ y (+ x 1.0)) (+ y x))
   (if (<= y 1.85e+165)
     (/ x (* (+ y x) (+ 1.0 (+ y (* x 2.0)))))
     (* (/ x (+ y x)) (/ 1.0 y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 2.2e-183) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else if (y <= 1.85e+165) {
		tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
	} else {
		tmp = (x / (y + x)) * (1.0 / y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.2d-183) then
        tmp = (y / (x + 1.0d0)) / (y + x)
    else if (y <= 1.85d+165) then
        tmp = x / ((y + x) * (1.0d0 + (y + (x * 2.0d0))))
    else
        tmp = (x / (y + x)) * (1.0d0 / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.2e-183) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else if (y <= 1.85e+165) {
		tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
	} else {
		tmp = (x / (y + x)) * (1.0 / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 2.2e-183:
		tmp = (y / (x + 1.0)) / (y + x)
	elif y <= 1.85e+165:
		tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))))
	else:
		tmp = (x / (y + x)) * (1.0 / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 2.2e-183)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x));
	elseif (y <= 1.85e+165)
		tmp = Float64(x / Float64(Float64(y + x) * Float64(1.0 + Float64(y + Float64(x * 2.0)))));
	else
		tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.2e-183)
		tmp = (y / (x + 1.0)) / (y + x);
	elseif (y <= 1.85e+165)
		tmp = x / ((y + x) * (1.0 + (y + (x * 2.0))));
	else
		tmp = (x / (y + x)) * (1.0 / y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 2.2e-183], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85e+165], N[(x / N[(N[(y + x), $MachinePrecision] * N[(1.0 + N[(y + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{+165}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(1 + \left(y + x \cdot 2\right)\right)}\\

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


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

    1. Initial program 65.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. Step-by-step derivation
      1. times-frac83.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/75.4%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.1%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.2%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.2%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/94.3%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative94.3%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified94.3%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in y around 0 55.0%

      \[\leadsto \frac{x}{\color{blue}{\frac{x \cdot \left(1 + x\right)}{y}} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. *-lft-identity55.0%

        \[\leadsto \color{blue}{1 \cdot \frac{x}{\frac{x \cdot \left(1 + x\right)}{y} \cdot \left(y + x\right)}} \]
      2. +-commutative55.0%

        \[\leadsto 1 \cdot \frac{x}{\frac{x \cdot \left(1 + x\right)}{y} \cdot \color{blue}{\left(x + y\right)}} \]
      3. associate-/r*56.3%

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{x}{\frac{x \cdot \left(1 + x\right)}{y}}}{x + y}} \]
      4. associate-/r/57.0%

        \[\leadsto 1 \cdot \frac{\color{blue}{\frac{x}{x \cdot \left(1 + x\right)} \cdot y}}{x + y} \]
      5. *-commutative57.0%

        \[\leadsto 1 \cdot \frac{\color{blue}{y \cdot \frac{x}{x \cdot \left(1 + x\right)}}}{x + y} \]
      6. associate-/r*58.8%

        \[\leadsto 1 \cdot \frac{y \cdot \color{blue}{\frac{\frac{x}{x}}{1 + x}}}{x + y} \]
      7. *-inverses58.8%

        \[\leadsto 1 \cdot \frac{y \cdot \frac{\color{blue}{1}}{1 + x}}{x + y} \]
      8. div-inv58.8%

        \[\leadsto 1 \cdot \frac{\color{blue}{\frac{y}{1 + x}}}{x + y} \]
      9. +-commutative58.8%

        \[\leadsto 1 \cdot \frac{\frac{y}{\color{blue}{x + 1}}}{x + y} \]
    10. Applied egg-rr58.8%

      \[\leadsto \color{blue}{1 \cdot \frac{\frac{y}{x + 1}}{x + y}} \]
    11. Step-by-step derivation
      1. *-lft-identity58.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{x + y}} \]
      2. +-commutative58.8%

        \[\leadsto \frac{\frac{y}{\color{blue}{1 + x}}}{x + y} \]
      3. +-commutative58.8%

        \[\leadsto \frac{\frac{y}{1 + x}}{\color{blue}{y + x}} \]
    12. Simplified58.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{1 + x}}{y + x}} \]

    if 2.2e-183 < y < 1.85000000000000003e165

    1. Initial program 80.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. Step-by-step derivation
      1. times-frac92.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+92.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/90.6%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num98.9%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv98.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative98.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative98.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr98.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/90.6%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative90.6%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified90.6%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in y around inf 74.6%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + \left(y + 2 \cdot x\right)\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. *-commutative74.6%

        \[\leadsto \frac{x}{\left(1 + \left(y + \color{blue}{x \cdot 2}\right)\right) \cdot \left(y + x\right)} \]
    10. Simplified74.6%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + \left(y + x \cdot 2\right)\right)} \cdot \left(y + x\right)} \]

    if 1.85000000000000003e165 < y

    1. Initial program 53.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. Step-by-step derivation
      1. times-frac80.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+80.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/80.1%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in y around inf 88.2%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(1 + \left(y + x \cdot 2\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\ \end{array} \]

Alternative 8: 91.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;x \leq -2.55 \cdot 10^{+16}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{\frac{y}{y + 1}}{y + x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ y x))))
   (if (<= x -2.55e+16)
     (* t_0 (/ (/ y x) (+ y x)))
     (* t_0 (/ (/ y (+ y 1.0)) (+ y x))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -2.55e+16) {
		tmp = t_0 * ((y / x) / (y + x));
	} else {
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 + x)
    if (x <= (-2.55d+16)) then
        tmp = t_0 * ((y / x) / (y + x))
    else
        tmp = t_0 * ((y / (y + 1.0d0)) / (y + x))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (x <= -2.55e+16) {
		tmp = t_0 * ((y / x) / (y + x));
	} else {
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + x)
	tmp = 0
	if x <= -2.55e+16:
		tmp = t_0 * ((y / x) / (y + x))
	else:
		tmp = t_0 * ((y / (y + 1.0)) / (y + x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + x))
	tmp = 0.0
	if (x <= -2.55e+16)
		tmp = Float64(t_0 * Float64(Float64(y / x) / Float64(y + x)));
	else
		tmp = Float64(t_0 * Float64(Float64(y / Float64(y + 1.0)) / Float64(y + x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + x);
	tmp = 0.0;
	if (x <= -2.55e+16)
		tmp = t_0 * ((y / x) / (y + x));
	else
		tmp = t_0 * ((y / (y + 1.0)) / (y + x));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.55e+16], N[(t$95$0 * N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -2.55 \cdot 10^{+16}:\\
\;\;\;\;t_0 \cdot \frac{\frac{y}{x}}{y + x}\\

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 85.5%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{x + y} \]

    if -2.55e16 < x

    1. Initial program 69.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. Step-by-step derivation
      1. times-frac86.3%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/79.9%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around 0 85.2%

      \[\leadsto \frac{\color{blue}{\frac{y}{1 + y}}}{x + y} \cdot \frac{x}{x + y} \]
    5. Step-by-step derivation
      1. +-commutative78.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified85.2%

      \[\leadsto \frac{\color{blue}{\frac{y}{y + 1}}}{x + y} \cdot \frac{x}{x + y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.55 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{\frac{y}{y + 1}}{y + x}\\ \end{array} \]

Alternative 9: 81.2% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -90000000000000:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + \left(x + 1\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -90000000000000.0)
   (/ (/ y x) x)
   (if (<= x -5.2e-26)
     (/ x (* (+ y 1.0) (+ y x)))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y (+ x 1.0)))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -90000000000000.0) {
		tmp = (y / x) / x;
	} else if (x <= -5.2e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + (x + 1.0));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-90000000000000.0d0)) then
        tmp = (y / x) / x
    else if (x <= (-5.2d-26)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + (x + 1.0d0))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -90000000000000.0) {
		tmp = (y / x) / x;
	} else if (x <= -5.2e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + (x + 1.0));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -90000000000000.0:
		tmp = (y / x) / x
	elif x <= -5.2e-26:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + (x + 1.0))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -90000000000000.0)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -5.2e-26)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + Float64(x + 1.0)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -90000000000000.0)
		tmp = (y / x) / x;
	elseif (x <= -5.2e-26)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + (x + 1.0));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -90000000000000.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -5.2e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -90000000000000:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -9e13 < x < -5.2000000000000002e-26

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -5.2000000000000002e-26 < x < -1.00000000000000004e-134

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/82.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative82.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/71.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.3%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.3%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 59.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y + \left(x + 1\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -90000000000000:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 10: 81.3% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ t_1 := \frac{\frac{y}{x}}{t_0}\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t_0}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ y (+ x 1.0))) (t_1 (/ (/ y x) t_0)))
   (if (<= x -6.8e+14)
     t_1
     (if (<= x -2e-24)
       (/ x (* (+ y 1.0) (+ y x)))
       (if (<= x -1e-134) t_1 (/ (/ x y) t_0))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / x) / t_0;
	double tmp;
	if (x <= -6.8e+14) {
		tmp = t_1;
	} else if (x <= -2e-24) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / y) / t_0;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 = y + (x + 1.0d0)
    t_1 = (y / x) / t_0
    if (x <= (-6.8d+14)) then
        tmp = t_1
    else if (x <= (-2d-24)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = t_1
    else
        tmp = (x / y) / t_0
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = (y / x) / t_0;
	double tmp;
	if (x <= -6.8e+14) {
		tmp = t_1;
	} else if (x <= -2e-24) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = t_1;
	} else {
		tmp = (x / y) / t_0;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	t_1 = (y / x) / t_0
	tmp = 0
	if x <= -6.8e+14:
		tmp = t_1
	elif x <= -2e-24:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = t_1
	else:
		tmp = (x / y) / t_0
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	t_1 = Float64(Float64(y / x) / t_0)
	tmp = 0.0
	if (x <= -6.8e+14)
		tmp = t_1;
	elseif (x <= -2e-24)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / y) / t_0);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y + (x + 1.0);
	t_1 = (y / x) / t_0;
	tmp = 0.0;
	if (x <= -6.8e+14)
		tmp = t_1;
	elseif (x <= -2e-24)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = t_1;
	else
		tmp = (x / y) / t_0;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[x, -6.8e+14], t$95$1, If[LessEqual[x, -2e-24], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], t$95$1, N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{\frac{y}{x}}{t_0}\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.8e14 or -1.99999999999999985e-24 < x < -1.00000000000000004e-134

    1. Initial program 71.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. Step-by-step derivation
      1. times-frac89.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/89.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative89.1%

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

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

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/76.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*80.6%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative80.6%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+80.6%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified80.6%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Step-by-step derivation
      1. associate-/l*99.8%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
      2. div-inv99.7%

        \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{1}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x \cdot \frac{1}{\color{blue}{\frac{1}{\frac{y}{x + y}}}}}{x + y}}{y + \left(x + 1\right)} \]
      4. remove-double-div99.9%

        \[\leadsto \frac{\frac{x \cdot \color{blue}{\frac{y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
    5. Applied egg-rr99.9%

      \[\leadsto \frac{\frac{\color{blue}{x \cdot \frac{y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
    6. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x \cdot y}{x + y}}}{x + y}}{y + \left(x + 1\right)} \]
      2. associate-/l*99.8%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
    7. Simplified99.8%

      \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{y + \left(x + 1\right)} \]
    8. Taylor expanded in x around inf 70.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + \left(x + 1\right)} \]

    if -6.8e14 < x < -1.99999999999999985e-24

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/82.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative82.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative82.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/71.1%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*73.3%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative73.3%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+73.3%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified73.3%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 59.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y + \left(x + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + \left(x + 1\right)}\\ \end{array} \]

Alternative 11: 79.6% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-26} \lor \neg \left(x \leq -1 \cdot 10^{-134}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -9.6e+14)
   (/ (/ y x) x)
   (if (or (<= x -1.15e-26) (not (<= x -1e-134)))
     (/ x (* y (+ y 1.0)))
     (/ y x))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -9.6e+14) {
		tmp = (y / x) / x;
	} else if ((x <= -1.15e-26) || !(x <= -1e-134)) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = y / x;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-9.6d+14)) then
        tmp = (y / x) / x
    else if ((x <= (-1.15d-26)) .or. (.not. (x <= (-1d-134)))) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = y / x
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -9.6e+14) {
		tmp = (y / x) / x;
	} else if ((x <= -1.15e-26) || !(x <= -1e-134)) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = y / x;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -9.6e+14:
		tmp = (y / x) / x
	elif (x <= -1.15e-26) or not (x <= -1e-134):
		tmp = x / (y * (y + 1.0))
	else:
		tmp = y / x
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -9.6e+14)
		tmp = Float64(Float64(y / x) / x);
	elseif ((x <= -1.15e-26) || !(x <= -1e-134))
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(y / x);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -9.6e+14)
		tmp = (y / x) / x;
	elseif ((x <= -1.15e-26) || ~((x <= -1e-134)))
		tmp = x / (y * (y + 1.0));
	else
		tmp = y / x;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -9.6e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -1.15e-26], N[Not[LessEqual[x, -1e-134]], $MachinePrecision]], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-26} \lor \neg \left(x \leq -1 \cdot 10^{-134}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -9.6e14 < x < -1.15000000000000004e-26 or -1.00000000000000004e-134 < x

    1. Initial program 67.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. Step-by-step derivation
      1. times-frac84.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity84.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity84.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+84.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 60.7%

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

    if -1.15000000000000004e-26 < x < -1.00000000000000004e-134

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-26} \lor \neg \left(x \leq -1 \cdot 10^{-134}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]

Alternative 12: 72.7% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{\frac{y}{x}}{x}\\ \mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-146}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.7:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ y x) x)))
   (if (<= y -6.8e-77)
     t_0
     (if (<= y 8.8e-146) (/ y x) (if (<= y 6.7) t_0 (* (/ 1.0 y) (/ x y)))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = (y / x) / x;
	double tmp;
	if (y <= -6.8e-77) {
		tmp = t_0;
	} else if (y <= 8.8e-146) {
		tmp = y / x;
	} else if (y <= 6.7) {
		tmp = t_0;
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-6.8d-77)) then
        tmp = t_0
    else if (y <= 8.8d-146) then
        tmp = y / x
    else if (y <= 6.7d0) then
        tmp = t_0
    else
        tmp = (1.0d0 / y) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = (y / x) / x;
	double tmp;
	if (y <= -6.8e-77) {
		tmp = t_0;
	} else if (y <= 8.8e-146) {
		tmp = y / x;
	} else if (y <= 6.7) {
		tmp = t_0;
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = (y / x) / x
	tmp = 0
	if y <= -6.8e-77:
		tmp = t_0
	elif y <= 8.8e-146:
		tmp = y / x
	elif y <= 6.7:
		tmp = t_0
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(Float64(y / x) / x)
	tmp = 0.0
	if (y <= -6.8e-77)
		tmp = t_0;
	elseif (y <= 8.8e-146)
		tmp = Float64(y / x);
	elseif (y <= 6.7)
		tmp = t_0;
	else
		tmp = Float64(Float64(1.0 / y) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = (y / x) / x;
	tmp = 0.0;
	if (y <= -6.8e-77)
		tmp = t_0;
	elseif (y <= 8.8e-146)
		tmp = y / x;
	elseif (y <= 6.7)
		tmp = t_0;
	else
		tmp = (1.0 / y) * (x / y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -6.8e-77], t$95$0, If[LessEqual[y, 8.8e-146], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.7], t$95$0, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x}}{x}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 8.8 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 6.7:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.79999999999999966e-77 or 8.8e-146 < y < 6.70000000000000018

    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. Step-by-step derivation
      1. times-frac94.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+94.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/93.0%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 38.5%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow238.5%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*41.0%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified41.0%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -6.79999999999999966e-77 < y < 8.8e-146

    1. Initial program 59.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. Step-by-step derivation
      1. times-frac74.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified74.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 80.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 68.8%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 6.70000000000000018 < y

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac86.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative86.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-*r/85.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
      4. *-commutative85.9%

        \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
      5. +-commutative85.9%

        \[\leadsto \frac{y \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(y + x\right) + 1} \]
      6. +-commutative85.9%

        \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
      7. associate-*r/70.2%

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
      8. associate-/r*75.5%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
      9. *-commutative75.5%

        \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
      10. +-commutative75.5%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
      11. +-commutative75.5%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
      12. associate-+l+75.5%

        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified75.5%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 80.6%

      \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. clear-num79.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}}} \]
      2. inv-pow79.7%

        \[\leadsto \color{blue}{{\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{-1}} \]
      3. metadata-eval79.7%

        \[\leadsto {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\color{blue}{\left(-1\right)}} \]
      4. sqr-pow67.4%

        \[\leadsto \color{blue}{{\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      5. div-inv67.4%

        \[\leadsto {\color{blue}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{1}{\frac{x}{x + y}}\right)}}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. clear-num67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \color{blue}{\frac{x + y}{x}}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. +-commutative67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{x}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      9. metadata-eval67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{y + \left(x + 1\right)}{\frac{x}{x + y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      10. div-inv67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\color{blue}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{1}{\frac{x}{x + y}}\right)}}^{\left(\frac{-1}{2}\right)} \]
      11. clear-num67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\left(\left(y + \left(x + 1\right)\right) \cdot \color{blue}{\frac{x + y}{x}}\right)}^{\left(\frac{-1}{2}\right)} \]
      12. +-commutative67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{x}\right)}^{\left(\frac{-1}{2}\right)} \]
      13. metadata-eval67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)} \]
      14. metadata-eval67.4%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\color{blue}{-0.5}} \]
    6. Applied egg-rr67.4%

      \[\leadsto \color{blue}{{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5} \cdot {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{-0.5}} \]
    7. Step-by-step derivation
      1. pow-sqr79.7%

        \[\leadsto \color{blue}{{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval79.7%

        \[\leadsto {\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}\right)}^{\color{blue}{-1}} \]
      3. unpow-179.7%

        \[\leadsto \color{blue}{\frac{1}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}}} \]
    8. Simplified79.7%

      \[\leadsto \color{blue}{\frac{1}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{x}}} \]
    9. Taylor expanded in y around inf 75.6%

      \[\leadsto \frac{1}{\color{blue}{\frac{{y}^{2}}{x}}} \]
    10. Step-by-step derivation
      1. unpow275.6%

        \[\leadsto \frac{1}{\frac{\color{blue}{y \cdot y}}{x}} \]
    11. Simplified75.6%

      \[\leadsto \frac{1}{\color{blue}{\frac{y \cdot y}{x}}} \]
    12. Step-by-step derivation
      1. associate-/l*76.3%

        \[\leadsto \frac{1}{\color{blue}{\frac{y}{\frac{x}{y}}}} \]
      2. associate-/r/77.2%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
      3. *-commutative77.2%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    13. Applied egg-rr77.2%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-146}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.7:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 13: 81.2% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{-135}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -2.45e+14)
   (/ (/ y x) x)
   (if (<= x -3.3e-24)
     (/ x (* y (+ y 1.0)))
     (if (<= x -8.8e-135) (/ y x) (/ (/ x y) (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -2.45e+14) {
		tmp = (y / x) / x;
	} else if (x <= -3.3e-24) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -8.8e-135) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-2.45d+14)) then
        tmp = (y / x) / x
    else if (x <= (-3.3d-24)) then
        tmp = x / (y * (y + 1.0d0))
    else if (x <= (-8.8d-135)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -2.45e+14) {
		tmp = (y / x) / x;
	} else if (x <= -3.3e-24) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -8.8e-135) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -2.45e+14:
		tmp = (y / x) / x
	elif x <= -3.3e-24:
		tmp = x / (y * (y + 1.0))
	elif x <= -8.8e-135:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -2.45e+14)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -3.3e-24)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	elseif (x <= -8.8e-135)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -2.45e+14)
		tmp = (y / x) / x;
	elseif (x <= -3.3e-24)
		tmp = x / (y * (y + 1.0));
	elseif (x <= -8.8e-135)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -2.45e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -3.3e-24], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.8e-135], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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

\mathbf{elif}\;x \leq -8.8 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -2.45e14 < x < -3.29999999999999984e-24

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 90.8%

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

    if -3.29999999999999984e-24 < x < -8.7999999999999999e-135

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if -8.7999999999999999e-135 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified82.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 58.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*59.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative59.1%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified59.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-24}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.8 \cdot 10^{-135}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 14: 81.2% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -4.7e+14)
   (/ (/ y x) x)
   (if (<= x -2.1e-23)
     (/ 1.0 (/ (* y (+ y 1.0)) x))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.7e+14) {
		tmp = (y / x) / x;
	} else if (x <= -2.1e-23) {
		tmp = 1.0 / ((y * (y + 1.0)) / x);
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-4.7d+14)) then
        tmp = (y / x) / x
    else if (x <= (-2.1d-23)) then
        tmp = 1.0d0 / ((y * (y + 1.0d0)) / x)
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -4.7e+14) {
		tmp = (y / x) / x;
	} else if (x <= -2.1e-23) {
		tmp = 1.0 / ((y * (y + 1.0)) / x);
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -4.7e+14:
		tmp = (y / x) / x
	elif x <= -2.1e-23:
		tmp = 1.0 / ((y * (y + 1.0)) / x)
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -4.7e+14)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -2.1e-23)
		tmp = Float64(1.0 / Float64(Float64(y * Float64(y + 1.0)) / x));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4.7e+14)
		tmp = (y / x) / x;
	elseif (x <= -2.1e-23)
		tmp = 1.0 / ((y * (y + 1.0)) / x);
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -4.7e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.1e-23], N[(1.0 / N[(N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -4.7e14 < x < -2.1000000000000001e-23

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 90.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*91.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative91.0%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified91.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
    7. Step-by-step derivation
      1. clear-num90.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      2. inv-pow90.8%

        \[\leadsto \color{blue}{{\left(\frac{y + 1}{\frac{x}{y}}\right)}^{-1}} \]
      3. metadata-eval90.8%

        \[\leadsto {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\color{blue}{\left(-1\right)}} \]
      4. sqr-pow45.7%

        \[\leadsto \color{blue}{{\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)}} \]
      5. associate-/r/45.7%

        \[\leadsto {\color{blue}{\left(\frac{y + 1}{x} \cdot y\right)}}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      6. *-commutative45.7%

        \[\leadsto {\color{blue}{\left(y \cdot \frac{y + 1}{x}\right)}}^{\left(\frac{-1}{2}\right)} \cdot {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      7. metadata-eval45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)} \cdot {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      8. metadata-eval45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{\color{blue}{-0.5}} \cdot {\left(\frac{y + 1}{\frac{x}{y}}\right)}^{\left(\frac{-1}{2}\right)} \]
      9. associate-/r/45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5} \cdot {\color{blue}{\left(\frac{y + 1}{x} \cdot y\right)}}^{\left(\frac{-1}{2}\right)} \]
      10. *-commutative45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5} \cdot {\color{blue}{\left(y \cdot \frac{y + 1}{x}\right)}}^{\left(\frac{-1}{2}\right)} \]
      11. metadata-eval45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5} \cdot {\left(y \cdot \frac{y + 1}{x}\right)}^{\left(\frac{\color{blue}{-1}}{2}\right)} \]
      12. metadata-eval45.7%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5} \cdot {\left(y \cdot \frac{y + 1}{x}\right)}^{\color{blue}{-0.5}} \]
    8. Applied egg-rr45.7%

      \[\leadsto \color{blue}{{\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5} \cdot {\left(y \cdot \frac{y + 1}{x}\right)}^{-0.5}} \]
    9. Step-by-step derivation
      1. pow-sqr91.0%

        \[\leadsto \color{blue}{{\left(y \cdot \frac{y + 1}{x}\right)}^{\left(2 \cdot -0.5\right)}} \]
      2. metadata-eval91.0%

        \[\leadsto {\left(y \cdot \frac{y + 1}{x}\right)}^{\color{blue}{-1}} \]
      3. unpow-191.0%

        \[\leadsto \color{blue}{\frac{1}{y \cdot \frac{y + 1}{x}}} \]
      4. +-commutative91.0%

        \[\leadsto \frac{1}{y \cdot \frac{\color{blue}{1 + y}}{x}} \]
      5. associate-*r/90.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{y \cdot \left(1 + y\right)}{x}}} \]
      6. +-commutative90.8%

        \[\leadsto \frac{1}{\frac{y \cdot \color{blue}{\left(y + 1\right)}}{x}} \]
    10. Simplified90.8%

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

    if -2.1000000000000001e-23 < x < -1.00000000000000004e-134

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified82.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 58.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*59.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative59.1%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified59.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-23}:\\ \;\;\;\;\frac{1}{\frac{y \cdot \left(y + 1\right)}{x}}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 15: 81.2% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -3.6e+14)
   (/ (/ y x) x)
   (if (<= x -1.4e-26)
     (/ x (* (+ y 1.0) (+ y x)))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -3.6e+14) {
		tmp = (y / x) / x;
	} else if (x <= -1.4e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-3.6d+14)) then
        tmp = (y / x) / x
    else if (x <= (-1.4d-26)) then
        tmp = x / ((y + 1.0d0) * (y + x))
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -3.6e+14) {
		tmp = (y / x) / x;
	} else if (x <= -1.4e-26) {
		tmp = x / ((y + 1.0) * (y + x));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -3.6e+14:
		tmp = (y / x) / x
	elif x <= -1.4e-26:
		tmp = x / ((y + 1.0) * (y + x))
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -3.6e+14)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -1.4e-26)
		tmp = Float64(x / Float64(Float64(y + 1.0) * Float64(y + x)));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -3.6e+14)
		tmp = (y / x) / x;
	elseif (x <= -1.4e-26)
		tmp = x / ((y + 1.0) * (y + x));
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -3.6e+14], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.4e-26], N[(x / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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

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

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -3.6e14 < x < -1.4000000000000001e-26

    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. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Step-by-step derivation
      1. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      2. clear-num99.7%

        \[\leadsto \frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      3. un-div-inv99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}}} \]
      4. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + y}{\frac{y}{x + \left(y + 1\right)}}} \]
      5. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(x + y\right) + 1}}}} \]
      6. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{\left(y + x\right)} + 1}}} \]
      7. associate-+r+99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{x + y}{\frac{y}{\color{blue}{y + \left(x + 1\right)}}}} \]
      8. associate-/r/99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}} \]
      9. *-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{y + x}}{y}} \]
    5. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}}} \]
    6. Step-by-step derivation
      1. associate-/l/99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + \left(x + 1\right)\right) \cdot \frac{y + x}{y}\right) \cdot \left(y + x\right)}} \]
      2. *-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right)} \cdot \left(y + x\right)} \]
    7. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)\right) \cdot \left(y + x\right)}} \]
    8. Taylor expanded in x around 0 91.0%

      \[\leadsto \frac{x}{\color{blue}{\left(1 + y\right)} \cdot \left(y + x\right)} \]
    9. Step-by-step derivation
      1. +-commutative91.0%

        \[\leadsto \frac{x}{\color{blue}{\left(y + 1\right)} \cdot \left(y + x\right)} \]
    10. Simplified91.0%

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

    if -1.4000000000000001e-26 < x < -1.00000000000000004e-134

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if -1.00000000000000004e-134 < x

    1. Initial program 66.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. Step-by-step derivation
      1. times-frac82.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+82.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified82.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 58.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*59.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative59.1%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified59.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 16: 69.0% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+16}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-23} \lor \neg \left(x \leq -5.5 \cdot 10^{-137}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.05e+16)
   (/ (/ y x) x)
   (if (or (<= x -3.2e-23) (not (<= x -5.5e-137))) (/ x (* y y)) (/ y x))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.05e+16) {
		tmp = (y / x) / x;
	} else if ((x <= -3.2e-23) || !(x <= -5.5e-137)) {
		tmp = x / (y * y);
	} else {
		tmp = y / x;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.05d+16)) then
        tmp = (y / x) / x
    else if ((x <= (-3.2d-23)) .or. (.not. (x <= (-5.5d-137)))) then
        tmp = x / (y * y)
    else
        tmp = y / x
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.05e+16) {
		tmp = (y / x) / x;
	} else if ((x <= -3.2e-23) || !(x <= -5.5e-137)) {
		tmp = x / (y * y);
	} else {
		tmp = y / x;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.05e+16:
		tmp = (y / x) / x
	elif (x <= -3.2e-23) or not (x <= -5.5e-137):
		tmp = x / (y * y)
	else:
		tmp = y / x
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.05e+16)
		tmp = Float64(Float64(y / x) / x);
	elseif ((x <= -3.2e-23) || !(x <= -5.5e-137))
		tmp = Float64(x / Float64(y * y));
	else
		tmp = Float64(y / x);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.05e+16)
		tmp = (y / x) / x;
	elseif ((x <= -3.2e-23) || ~((x <= -5.5e-137)))
		tmp = x / (y * y);
	else
		tmp = y / x;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.05e+16], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -3.2e-23], N[Not[LessEqual[x, -5.5e-137]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-23} \lor \neg \left(x \leq -5.5 \cdot 10^{-137}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


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

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac83.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+83.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/83.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.9%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in x around inf 75.2%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.2%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/r*84.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    6. Simplified84.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]

    if -1.05e16 < x < -3.19999999999999976e-23 or -5.5000000000000003e-137 < x

    1. Initial program 67.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. Step-by-step derivation
      1. times-frac84.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+84.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/78.3%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in y around inf 46.1%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow246.1%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified46.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]

    if -3.19999999999999976e-23 < x < -5.5000000000000003e-137

    1. Initial program 86.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. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 45.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification54.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+16}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-23} \lor \neg \left(x \leq -5.5 \cdot 10^{-137}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]

Alternative 17: 69.1% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-146}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.7:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ y (* x x))))
   (if (<= y -6.8e-77)
     t_0
     (if (<= y 1.65e-146) (/ y x) (if (<= y 6.7) t_0 (/ x (* y y)))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -6.8e-77) {
		tmp = t_0;
	} else if (y <= 1.65e-146) {
		tmp = y / x;
	} else if (y <= 6.7) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
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 <= (-6.8d-77)) then
        tmp = t_0
    else if (y <= 1.65d-146) then
        tmp = y / x
    else if (y <= 6.7d0) then
        tmp = t_0
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -6.8e-77) {
		tmp = t_0;
	} else if (y <= 1.65e-146) {
		tmp = y / x;
	} else if (y <= 6.7) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (x * x)
	tmp = 0
	if y <= -6.8e-77:
		tmp = t_0
	elif y <= 1.65e-146:
		tmp = y / x
	elif y <= 6.7:
		tmp = t_0
	else:
		tmp = x / (y * y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -6.8e-77)
		tmp = t_0;
	elseif (y <= 1.65e-146)
		tmp = Float64(y / x);
	elseif (y <= 6.7)
		tmp = t_0;
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y / (x * x);
	tmp = 0.0;
	if (y <= -6.8e-77)
		tmp = t_0;
	elseif (y <= 1.65e-146)
		tmp = y / x;
	elseif (y <= 6.7)
		tmp = t_0;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e-77], t$95$0, If[LessEqual[y, 1.65e-146], N[(y / x), $MachinePrecision], If[LessEqual[y, 6.7], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-146}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 6.7:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.79999999999999966e-77 or 1.65e-146 < y < 6.70000000000000018

    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. Step-by-step derivation
      1. times-frac94.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity94.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity94.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+94.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around inf 38.5%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow238.5%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified38.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

    if -6.79999999999999966e-77 < y < 1.65e-146

    1. Initial program 59.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. Step-by-step derivation
      1. times-frac74.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+74.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified74.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 80.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 68.8%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 6.70000000000000018 < y

    1. Initial program 63.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. Step-by-step derivation
      1. times-frac86.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+86.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/85.9%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.6%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.6%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in y around inf 75.6%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow275.6%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified75.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.8 \cdot 10^{-77}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-146}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 6.7:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 18: 58.8% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.7 \cdot 10^{-76}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (if (<= y 4.7e-76) (/ y x) (/ x (* y y))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 4.7e-76) {
		tmp = y / x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.7d-76) then
        tmp = y / x
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.7e-76) {
		tmp = y / x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 4.7e-76:
		tmp = y / x
	else:
		tmp = x / (y * y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 4.7e-76)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.7e-76)
		tmp = y / x;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 4.7e-76], N[(y / x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.7 \cdot 10^{-76}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 67.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. Step-by-step derivation
      1. times-frac83.8%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity83.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. /-rgt-identity83.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
      4. associate-+l+83.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified83.8%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 58.8%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Taylor expanded in x around 0 38.4%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 4.7000000000000002e-76 < y

    1. Initial program 70.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. Step-by-step derivation
      1. times-frac89.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+89.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/89.0%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. *-commutative99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \cdot \frac{x}{x + y}} \]
    4. Taylor expanded in y around inf 59.6%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow259.6%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified59.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification45.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.7 \cdot 10^{-76}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 19: 4.4% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{1}{x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ 1.0 x))
assert(x < y);
double code(double x, double y) {
	return 1.0 / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
assert x < y;
public static double code(double x, double y) {
	return 1.0 / x;
}
[x, y] = sort([x, y])
def code(x, y):
	return 1.0 / x
x, y = sort([x, y])
function code(x, y)
	return Float64(1.0 / x)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = 1.0 / x;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 68.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. Step-by-step derivation
    1. times-frac85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. +-commutative85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. associate-*r/85.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot y}{\left(y + x\right) + 1}} \]
    4. *-commutative85.6%

      \[\leadsto \frac{\color{blue}{y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}}}{\left(y + x\right) + 1} \]
    5. +-commutative85.6%

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

      \[\leadsto \frac{y \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(y + x\right) + 1} \]
    7. associate-*r/73.9%

      \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}}}{\left(y + x\right) + 1} \]
    8. associate-/r*76.8%

      \[\leadsto \frac{\color{blue}{\frac{\frac{y \cdot x}{y + x}}{y + x}}}{\left(y + x\right) + 1} \]
    9. *-commutative76.8%

      \[\leadsto \frac{\frac{\frac{\color{blue}{x \cdot y}}{y + x}}{y + x}}{\left(y + x\right) + 1} \]
    10. +-commutative76.8%

      \[\leadsto \frac{\frac{\frac{x \cdot y}{\color{blue}{x + y}}}{y + x}}{\left(y + x\right) + 1} \]
    11. +-commutative76.8%

      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\color{blue}{x + y}}}{\left(y + x\right) + 1} \]
    12. associate-+l+76.8%

      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{\color{blue}{y + \left(x + 1\right)}} \]
  3. Simplified76.8%

    \[\leadsto \color{blue}{\frac{\frac{\frac{x \cdot y}{x + y}}{x + y}}{y + \left(x + 1\right)}} \]
  4. Taylor expanded in x around 0 52.6%

    \[\leadsto \frac{\frac{\color{blue}{x}}{x + y}}{y + \left(x + 1\right)} \]
  5. Taylor expanded in x around inf 3.9%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  6. Final simplification3.9%

    \[\leadsto \frac{1}{x} \]

Alternative 20: 25.9% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{y}{x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ y x))
assert(x < y);
double code(double x, double y) {
	return y / x;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y / x
end function
assert x < y;
public static double code(double x, double y) {
	return y / x;
}
[x, y] = sort([x, y])
def code(x, y):
	return y / x
x, y = sort([x, y])
function code(x, y)
	return Float64(y / x)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = y / x;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{x}
\end{array}
Derivation
  1. Initial program 68.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. Step-by-step derivation
    1. times-frac85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. /-rgt-identity85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
    3. /-rgt-identity85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
    4. associate-+l+85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified85.6%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in y around 0 46.7%

    \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
  5. Taylor expanded in x around 0 26.3%

    \[\leadsto \color{blue}{\frac{y}{x}} \]
  6. Final simplification26.3%

    \[\leadsto \frac{y}{x} \]

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 2023297 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

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