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

Percentage Accurate: 69.7% → 99.8%
Time: 18.3s
Alternatives: 23
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 23 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: 69.7% 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{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (* (/ y (+ y x)) (/ (/ x (+ y (+ x 1.0))) (+ y x))))
assert(x < y);
double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (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 / (y + x)) * ((x / (y + (x + 1.0d0))) / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
[x, y] = sort([x, y])
def code(x, y):
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x))
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Derivation
  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. associate-+r+67.1%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.9% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{y + x}\\ \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{t_0}{x + 1}\\ \mathbf{elif}\;y \leq 36000000000:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + x} \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 (+ y x))))
   (if (<= y 3.9e-200)
     (/ (/ y (+ x 1.0)) x)
     (if (<= y 1.15e-134)
       (/ (/ x (+ y (+ x 1.0))) (+ y x))
       (if (<= y 5e-95)
         (/ t_0 (+ x 1.0))
         (if (<= y 36000000000.0)
           (/ x (* (+ y x) (+ y 1.0)))
           (* (/ t_0 (+ y x)) (/ x y))))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.15e-134) {
		tmp = (x / (y + (x + 1.0))) / (y + x);
	} else if (y <= 5e-95) {
		tmp = t_0 / (x + 1.0);
	} else if (y <= 36000000000.0) {
		tmp = x / ((y + x) * (y + 1.0));
	} else {
		tmp = (t_0 / (y + x)) * (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 / (y + x)
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.15d-134) then
        tmp = (x / (y + (x + 1.0d0))) / (y + x)
    else if (y <= 5d-95) then
        tmp = t_0 / (x + 1.0d0)
    else if (y <= 36000000000.0d0) then
        tmp = x / ((y + x) * (y + 1.0d0))
    else
        tmp = (t_0 / (y + x)) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.15e-134) {
		tmp = (x / (y + (x + 1.0))) / (y + x);
	} else if (y <= 5e-95) {
		tmp = t_0 / (x + 1.0);
	} else if (y <= 36000000000.0) {
		tmp = x / ((y + x) * (y + 1.0));
	} else {
		tmp = (t_0 / (y + x)) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (y + x)
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.15e-134:
		tmp = (x / (y + (x + 1.0))) / (y + x)
	elif y <= 5e-95:
		tmp = t_0 / (x + 1.0)
	elif y <= 36000000000.0:
		tmp = x / ((y + x) * (y + 1.0))
	else:
		tmp = (t_0 / (y + x)) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(y + x))
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.15e-134)
		tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x));
	elseif (y <= 5e-95)
		tmp = Float64(t_0 / Float64(x + 1.0));
	elseif (y <= 36000000000.0)
		tmp = Float64(x / Float64(Float64(y + x) * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y / (y + x);
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.15e-134)
		tmp = (x / (y + (x + 1.0))) / (y + x);
	elseif (y <= 5e-95)
		tmp = t_0 / (x + 1.0);
	elseif (y <= 36000000000.0)
		tmp = x / ((y + x) * (y + 1.0));
	else
		tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.15e-134], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 36000000000.0], N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

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

\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{t_0}{x + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.15e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-+r+70.0%

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

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

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

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

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

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

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

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

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

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

    if 1.15e-134 < y < 4.9999999999999998e-95

    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. associate-+r+86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-95 < y < 3.6e10

    1. Initial program 87.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. associate-*l*87.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative94.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative94.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult94.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative94.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified94.5%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Step-by-step derivation
      1. fma-udef90.7%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      2. cube-mult90.6%

        \[\leadsto y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in94.4%

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(y \cdot \left(1 + y\right)\right)}} \]
    7. Step-by-step derivation
      1. expm1-log1p-u38.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \frac{x}{\left(x + y\right) \cdot \left(y \cdot \left(1 + y\right)\right)}\right)\right)} \]
      2. expm1-udef5.4%

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

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \color{blue}{\frac{\frac{x}{x + y}}{y \cdot \left(1 + y\right)}}\right)} - 1 \]
      4. distribute-lft-in5.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \frac{\frac{x}{x + y}}{\color{blue}{y \cdot 1 + y \cdot y}}\right)} - 1 \]
      5. *-rgt-identity5.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \frac{\frac{x}{x + y}}{\color{blue}{y} + y \cdot y}\right)} - 1 \]
      6. pow25.4%

        \[\leadsto e^{\mathsf{log1p}\left(y \cdot \frac{\frac{x}{x + y}}{y + \color{blue}{{y}^{2}}}\right)} - 1 \]
    8. Applied egg-rr5.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(y \cdot \frac{\frac{x}{x + y}}{y + {y}^{2}}\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def38.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \frac{\frac{x}{x + y}}{y + {y}^{2}}\right)\right)} \]
      2. expm1-log1p38.5%

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

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

        \[\leadsto \frac{\color{blue}{\frac{y \cdot x}{x + y}}}{y + {y}^{2}} \]
      5. associate-/l/31.1%

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

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

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

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

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

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

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

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

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

    if 3.6e10 < y

    1. Initial program 59.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. associate-*l*59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
      2. div-inv82.0%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot 1}{x + y}} \cdot \frac{x}{y} \]
      2. *-rgt-identity82.0%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + y}}}{x + y} \cdot \frac{x}{y} \]
    8. Simplified82.0%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification62.6%

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

Alternative 3: 97.1% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 2 \cdot 10^{-21}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{1}{\frac{y + \left(x + 1\right)}{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 (<= y 2e-21)
   (* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x)))
   (if (<= y 7.8e+154)
     (* (/ y (* (+ y x) (+ y x))) (/ x (+ x (+ y 1.0))))
     (* (/ 1.0 y) (/ 1.0 (/ (+ y (+ x 1.0)) x))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 2e-21) {
		tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
	} else if (y <= 7.8e+154) {
		tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
	} else {
		tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / 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 (y <= 2d-21) then
        tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
    else if (y <= 7.8d+154) then
        tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0d0)))
    else
        tmp = (1.0d0 / y) * (1.0d0 / ((y + (x + 1.0d0)) / x))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 2e-21) {
		tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
	} else if (y <= 7.8e+154) {
		tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
	} else {
		tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 2e-21:
		tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x))
	elif y <= 7.8e+154:
		tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)))
	else:
		tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 2e-21)
		tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x)));
	elseif (y <= 7.8e+154)
		tmp = Float64(Float64(y / Float64(Float64(y + x) * Float64(y + x))) * Float64(x / Float64(x + Float64(y + 1.0))));
	else
		tmp = Float64(Float64(1.0 / y) * Float64(1.0 / Float64(Float64(y + Float64(x + 1.0)) / x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2e-21)
		tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
	elseif (y <= 7.8e+154)
		tmp = (y / ((y + x) * (y + x))) * (x / (x + (y + 1.0)));
	else
		tmp = (1.0 / y) * (1.0 / ((y + (x + 1.0)) / 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[y, 2e-21], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+154], N[(N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(1.0 / N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\

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

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


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

    1. Initial program 69.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. associate-+r+69.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999982e-21 < y < 7.8000000000000006e154

    1. Initial program 62.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*62.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.8000000000000006e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.2% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ t_1 := \frac{y}{y + x}\\ \mathbf{if}\;y \leq -3.05 \cdot 10^{+26}:\\ \;\;\;\;\frac{t_1}{x + \left(y + \left(y + 1\right)\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;t_1 \cdot \frac{x}{\left(y + x\right) \cdot t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{1}{\frac{t_0}{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 (+ y (+ x 1.0))) (t_1 (/ y (+ y x))))
   (if (<= y -3.05e+26)
     (/ t_1 (+ x (+ y (+ y 1.0))))
     (if (<= y 7.2e+154)
       (* t_1 (/ x (* (+ y x) t_0)))
       (* (/ 1.0 y) (/ 1.0 (/ t_0 x)))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double t_1 = y / (y + x);
	double tmp;
	if (y <= -3.05e+26) {
		tmp = t_1 / (x + (y + (y + 1.0)));
	} else if (y <= 7.2e+154) {
		tmp = t_1 * (x / ((y + x) * t_0));
	} else {
		tmp = (1.0 / y) * (1.0 / (t_0 / 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) :: t_1
    real(8) :: tmp
    t_0 = y + (x + 1.0d0)
    t_1 = y / (y + x)
    if (y <= (-3.05d+26)) then
        tmp = t_1 / (x + (y + (y + 1.0d0)))
    else if (y <= 7.2d+154) then
        tmp = t_1 * (x / ((y + x) * t_0))
    else
        tmp = (1.0d0 / y) * (1.0d0 / (t_0 / x))
    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);
	double tmp;
	if (y <= -3.05e+26) {
		tmp = t_1 / (x + (y + (y + 1.0)));
	} else if (y <= 7.2e+154) {
		tmp = t_1 * (x / ((y + x) * t_0));
	} else {
		tmp = (1.0 / y) * (1.0 / (t_0 / x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	t_1 = y / (y + x)
	tmp = 0
	if y <= -3.05e+26:
		tmp = t_1 / (x + (y + (y + 1.0)))
	elif y <= 7.2e+154:
		tmp = t_1 * (x / ((y + x) * t_0))
	else:
		tmp = (1.0 / y) * (1.0 / (t_0 / x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	t_1 = Float64(y / Float64(y + x))
	tmp = 0.0
	if (y <= -3.05e+26)
		tmp = Float64(t_1 / Float64(x + Float64(y + Float64(y + 1.0))));
	elseif (y <= 7.2e+154)
		tmp = Float64(t_1 * Float64(x / Float64(Float64(y + x) * t_0)));
	else
		tmp = Float64(Float64(1.0 / y) * Float64(1.0 / Float64(t_0 / x)));
	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);
	tmp = 0.0;
	if (y <= -3.05e+26)
		tmp = t_1 / (x + (y + (y + 1.0)));
	elseif (y <= 7.2e+154)
		tmp = t_1 * (x / ((y + x) * t_0));
	else
		tmp = (1.0 / y) * (1.0 / (t_0 / 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[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.05e+26], N[(t$95$1 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+154], N[(t$95$1 * N[(x / N[(N[(y + x), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(1.0 / N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
t_1 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq -3.05 \cdot 10^{+26}:\\
\;\;\;\;\frac{t_1}{x + \left(y + \left(y + 1\right)\right)}\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\
\;\;\;\;t_1 \cdot \frac{x}{\left(y + x\right) \cdot t_0}\\

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


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

    1. Initial program 59.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. associate-+r+59.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0500000000000001e26 < y < 7.2000000000000001e154

    1. Initial program 71.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-+r+71.0%

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

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

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

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

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

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

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

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

    if 7.2000000000000001e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.0% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{y + x}\\ \mathbf{if}\;y \leq 5.9 \cdot 10^{-161}:\\ \;\;\;\;\frac{t_0}{x + \left(y + \left(y + 1\right)\right)}\\ \mathbf{elif}\;y \leq 180000000:\\ \;\;\;\;\frac{x}{x + 1} \cdot \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + x} \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 (+ y x))))
   (if (<= y 5.9e-161)
     (/ t_0 (+ x (+ y (+ y 1.0))))
     (if (<= y 180000000.0)
       (* (/ x (+ x 1.0)) (/ y (* (+ y x) (+ y x))))
       (* (/ t_0 (+ y x)) (/ x y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 5.9e-161) {
		tmp = t_0 / (x + (y + (y + 1.0)));
	} else if (y <= 180000000.0) {
		tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
	} else {
		tmp = (t_0 / (y + x)) * (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 / (y + x)
    if (y <= 5.9d-161) then
        tmp = t_0 / (x + (y + (y + 1.0d0)))
    else if (y <= 180000000.0d0) then
        tmp = (x / (x + 1.0d0)) * (y / ((y + x) * (y + x)))
    else
        tmp = (t_0 / (y + x)) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 5.9e-161) {
		tmp = t_0 / (x + (y + (y + 1.0)));
	} else if (y <= 180000000.0) {
		tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
	} else {
		tmp = (t_0 / (y + x)) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (y + x)
	tmp = 0
	if y <= 5.9e-161:
		tmp = t_0 / (x + (y + (y + 1.0)))
	elif y <= 180000000.0:
		tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)))
	else:
		tmp = (t_0 / (y + x)) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(y + x))
	tmp = 0.0
	if (y <= 5.9e-161)
		tmp = Float64(t_0 / Float64(x + Float64(y + Float64(y + 1.0))));
	elseif (y <= 180000000.0)
		tmp = Float64(Float64(x / Float64(x + 1.0)) * Float64(y / Float64(Float64(y + x) * Float64(y + x))));
	else
		tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y / (y + x);
	tmp = 0.0;
	if (y <= 5.9e-161)
		tmp = t_0 / (x + (y + (y + 1.0)));
	elseif (y <= 180000000.0)
		tmp = (x / (x + 1.0)) * (y / ((y + x) * (y + x)));
	else
		tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.9e-161], N[(t$95$0 / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 180000000.0], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 5.9 \cdot 10^{-161}:\\
\;\;\;\;\frac{t_0}{x + \left(y + \left(y + 1\right)\right)}\\

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

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


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

    1. Initial program 66.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-+r+66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9000000000000002e-161 < y < 1.8e8

    1. Initial program 83.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. associate-*l*83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8e8 < y

    1. Initial program 58.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. associate-*l*58.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
      2. div-inv80.9%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot 1}{x + y}} \cdot \frac{x}{y} \]
      2. *-rgt-identity80.9%

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

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

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

Alternative 6: 81.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \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 1.0)))))
   (if (<= y -3.2e+26)
     (* (/ y x) (/ 1.0 x))
     (if (<= y 3.9e-200)
       t_0
       (if (<= y 1.05e-134)
         (/ x y)
         (if (<= y 5e-95)
           t_0
           (if (<= y 7.2e+154)
             (/ x (* y (+ y 1.0)))
             (* (/ 1.0 y) (/ x y)))))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (x * (x + 1.0));
	double tmp;
	if (y <= -3.2e+26) {
		tmp = (y / x) * (1.0 / x);
	} else if (y <= 3.9e-200) {
		tmp = t_0;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 5e-95) {
		tmp = t_0;
	} else if (y <= 7.2e+154) {
		tmp = x / (y * (y + 1.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 + 1.0d0))
    if (y <= (-3.2d+26)) then
        tmp = (y / x) * (1.0d0 / x)
    else if (y <= 3.9d-200) then
        tmp = t_0
    else if (y <= 1.05d-134) then
        tmp = x / y
    else if (y <= 5d-95) then
        tmp = t_0
    else if (y <= 7.2d+154) then
        tmp = x / (y * (y + 1.0d0))
    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 + 1.0));
	double tmp;
	if (y <= -3.2e+26) {
		tmp = (y / x) * (1.0 / x);
	} else if (y <= 3.9e-200) {
		tmp = t_0;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 5e-95) {
		tmp = t_0;
	} else if (y <= 7.2e+154) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (x * (x + 1.0))
	tmp = 0
	if y <= -3.2e+26:
		tmp = (y / x) * (1.0 / x)
	elif y <= 3.9e-200:
		tmp = t_0
	elif y <= 1.05e-134:
		tmp = x / y
	elif y <= 5e-95:
		tmp = t_0
	elif y <= 7.2e+154:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(x * Float64(x + 1.0)))
	tmp = 0.0
	if (y <= -3.2e+26)
		tmp = Float64(Float64(y / x) * Float64(1.0 / x));
	elseif (y <= 3.9e-200)
		tmp = t_0;
	elseif (y <= 1.05e-134)
		tmp = Float64(x / y);
	elseif (y <= 5e-95)
		tmp = t_0;
	elseif (y <= 7.2e+154)
		tmp = Float64(x / Float64(y * Float64(y + 1.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 + 1.0));
	tmp = 0.0;
	if (y <= -3.2e+26)
		tmp = (y / x) * (1.0 / x);
	elseif (y <= 3.9e-200)
		tmp = t_0;
	elseif (y <= 1.05e-134)
		tmp = x / y;
	elseif (y <= 5e-95)
		tmp = t_0;
	elseif (y <= 7.2e+154)
		tmp = x / (y * (y + 1.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[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+26], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], t$95$0, If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 5e-95], t$95$0, If[LessEqual[y, 7.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;t_0\\

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

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


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

    1. Initial program 60.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. associate-+r+60.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
    5. Taylor expanded in y around 0 37.1%

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

    if -3.20000000000000029e26 < y < 3.89999999999999999e-200 or 1.05e-134 < y < 4.9999999999999998e-95

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-95 < y < 7.2000000000000001e154

    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. associate-*l*71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+26}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 7: 81.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{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
 (if (<= y 3.9e-200)
   (/ (/ y (+ x 1.0)) x)
   (if (<= y 1.05e-134)
     (/ x y)
     (if (<= y 2.6e-95)
       (/ y (* x (+ x 1.0)))
       (if (<= y 7.2e+154)
         (/ x (* y (+ y 1.0)))
         (* (/ x y) (/ 1.0 (+ y x))))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 2.6e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 7.2e+154) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / 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) :: tmp
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = x / y
    else if (y <= 2.6d-95) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 7.2d+154) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (x / y) * (1.0d0 / (y + x))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 2.6e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 7.2e+154) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) * (1.0 / (y + x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = x / y
	elif y <= 2.6e-95:
		tmp = y / (x * (x + 1.0))
	elif y <= 7.2e+154:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) * (1.0 / (y + x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = Float64(x / y);
	elseif (y <= 2.6e-95)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 7.2e+154)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / y) * Float64(1.0 / Float64(y + x)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = x / y;
	elseif (y <= 2.6e-95)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 7.2e+154)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / 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_] := If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 2.6e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-134 < y < 2.60000000000000001e-95

    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. associate-*l*86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.60000000000000001e-95 < y < 7.2000000000000001e154

    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. associate-*l*71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot 1}{x + y}} \cdot \frac{x}{y} \]
      2. *-rgt-identity96.1%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
    9. Taylor expanded in y around inf 96.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + x}\\ \end{array} \]

Alternative 8: 82.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{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 (+ y (+ x 1.0))))))
   (if (<= y 3.9e-200)
     (/ (/ y (+ x 1.0)) x)
     (if (<= y 1.05e-134)
       t_0
       (if (<= y 5e-95)
         (/ y (* x (+ x 1.0)))
         (if (<= y 8.8e+154) t_0 (* (/ x y) (/ 1.0 (+ y x)))))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y * (y + (x + 1.0)));
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = t_0;
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 8.8e+154) {
		tmp = t_0;
	} else {
		tmp = (x / 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 * (y + (x + 1.0d0)))
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = t_0
    else if (y <= 5d-95) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 8.8d+154) then
        tmp = t_0
    else
        tmp = (x / 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 * (y + (x + 1.0)));
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = t_0;
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 8.8e+154) {
		tmp = t_0;
	} else {
		tmp = (x / y) * (1.0 / (y + x));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y * (y + (x + 1.0)))
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = t_0
	elif y <= 5e-95:
		tmp = y / (x * (x + 1.0))
	elif y <= 8.8e+154:
		tmp = t_0
	else:
		tmp = (x / y) * (1.0 / (y + x))
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y * Float64(y + Float64(x + 1.0))))
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = t_0;
	elseif (y <= 5e-95)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 8.8e+154)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / y) * Float64(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 * (y + (x + 1.0)));
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = t_0;
	elseif (y <= 5e-95)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 8.8e+154)
		tmp = t_0;
	else
		tmp = (x / 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 * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], t$95$0, If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.8e+154], t$95$0, N[(N[(x / y), $MachinePrecision] * N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 8.8 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.05e-134 or 4.9999999999999998e-95 < y < 8.8000000000000004e154

    1. Initial program 71.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. associate-*l*71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-134 < y < 4.9999999999999998e-95

    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. associate-*l*86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.8000000000000004e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot 1}{x + y}} \cdot \frac{x}{y} \]
      2. *-rgt-identity96.1%

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
    9. Taylor expanded in y around inf 96.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y + x}\\ \end{array} \]

Alternative 9: 86.9% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + \left(x + 1\right)}\\ \mathbf{if}\;x \leq -3.4 \cdot 10^{-156}:\\ \;\;\;\;\frac{t_0}{y + x} \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{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 (/ x (+ y (+ x 1.0)))))
   (if (<= x -3.4e-156) (* (/ t_0 (+ y x)) (/ y x)) (/ t_0 y))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + (x + 1.0));
	double tmp;
	if (x <= -3.4e-156) {
		tmp = (t_0 / (y + x)) * (y / x);
	} else {
		tmp = t_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) :: t_0
    real(8) :: tmp
    t_0 = x / (y + (x + 1.0d0))
    if (x <= (-3.4d-156)) then
        tmp = (t_0 / (y + x)) * (y / x)
    else
        tmp = t_0 / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + (x + 1.0));
	double tmp;
	if (x <= -3.4e-156) {
		tmp = (t_0 / (y + x)) * (y / x);
	} else {
		tmp = t_0 / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + (x + 1.0))
	tmp = 0
	if x <= -3.4e-156:
		tmp = (t_0 / (y + x)) * (y / x)
	else:
		tmp = t_0 / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + Float64(x + 1.0)))
	tmp = 0.0
	if (x <= -3.4e-156)
		tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(y / x));
	else
		tmp = Float64(t_0 / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + (x + 1.0));
	tmp = 0.0;
	if (x <= -3.4e-156)
		tmp = (t_0 / (y + x)) * (y / x);
	else
		tmp = t_0 / 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[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-156], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-156}:\\
\;\;\;\;\frac{t_0}{y + x} \cdot \frac{y}{x}\\

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


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

    1. Initial program 62.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. associate-+r+62.7%

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

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

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

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

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

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

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

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

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

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

    if -3.3999999999999999e-156 < x

    1. Initial program 69.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. associate-*l*69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 94.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{y + x}\\ \mathbf{if}\;y \leq 54000000:\\ \;\;\;\;t_0 \cdot \frac{\frac{x}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + x} \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 (+ y x))))
   (if (<= y 54000000.0)
     (* t_0 (/ (/ x (+ x 1.0)) (+ y x)))
     (* (/ t_0 (+ y x)) (/ x y)))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 54000000.0) {
		tmp = t_0 * ((x / (x + 1.0)) / (y + x));
	} else {
		tmp = (t_0 / (y + x)) * (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 / (y + x)
    if (y <= 54000000.0d0) then
        tmp = t_0 * ((x / (x + 1.0d0)) / (y + x))
    else
        tmp = (t_0 / (y + x)) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (y <= 54000000.0) {
		tmp = t_0 * ((x / (x + 1.0)) / (y + x));
	} else {
		tmp = (t_0 / (y + x)) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (y + x)
	tmp = 0
	if y <= 54000000.0:
		tmp = t_0 * ((x / (x + 1.0)) / (y + x))
	else:
		tmp = (t_0 / (y + x)) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(y + x))
	tmp = 0.0
	if (y <= 54000000.0)
		tmp = Float64(t_0 * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x)));
	else
		tmp = Float64(Float64(t_0 / Float64(y + x)) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y / (y + x);
	tmp = 0.0;
	if (y <= 54000000.0)
		tmp = t_0 * ((x / (x + 1.0)) / (y + x));
	else
		tmp = (t_0 / (y + x)) * (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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 54000000.0], N[(t$95$0 * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq 54000000:\\
\;\;\;\;t_0 \cdot \frac{\frac{x}{x + 1}}{y + x}\\

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


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

    1. Initial program 70.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. associate-+r+70.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.4e7 < y

    1. Initial program 58.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. associate-*l*58.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
      2. div-inv80.9%

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot 1}{x + y}} \cdot \frac{x}{y} \]
      2. *-rgt-identity80.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 54000000:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{y + x} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 11: 74.4% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{if}\;y \leq -9.4 \cdot 10^{-135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+27}:\\ \;\;\;\;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) (/ 1.0 x))))
   (if (<= y -9.4e-135)
     t_0
     (if (<= y 3.9e-200)
       (/ y x)
       (if (<= y 3.3e-20)
         (/ x y)
         (if (<= y 3.4e+27) t_0 (* (/ 1.0 y) (/ x y))))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = (y / x) * (1.0 / x);
	double tmp;
	if (y <= -9.4e-135) {
		tmp = t_0;
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else if (y <= 3.3e-20) {
		tmp = x / y;
	} else if (y <= 3.4e+27) {
		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) * (1.0d0 / x)
    if (y <= (-9.4d-135)) then
        tmp = t_0
    else if (y <= 3.9d-200) then
        tmp = y / x
    else if (y <= 3.3d-20) then
        tmp = x / y
    else if (y <= 3.4d+27) 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) * (1.0 / x);
	double tmp;
	if (y <= -9.4e-135) {
		tmp = t_0;
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else if (y <= 3.3e-20) {
		tmp = x / y;
	} else if (y <= 3.4e+27) {
		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) * (1.0 / x)
	tmp = 0
	if y <= -9.4e-135:
		tmp = t_0
	elif y <= 3.9e-200:
		tmp = y / x
	elif y <= 3.3e-20:
		tmp = x / y
	elif y <= 3.4e+27:
		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) * Float64(1.0 / x))
	tmp = 0.0
	if (y <= -9.4e-135)
		tmp = t_0;
	elseif (y <= 3.9e-200)
		tmp = Float64(y / x);
	elseif (y <= 3.3e-20)
		tmp = Float64(x / y);
	elseif (y <= 3.4e+27)
		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) * (1.0 / x);
	tmp = 0.0;
	if (y <= -9.4e-135)
		tmp = t_0;
	elseif (y <= 3.9e-200)
		tmp = y / x;
	elseif (y <= 3.3e-20)
		tmp = x / y;
	elseif (y <= 3.4e+27)
		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] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.4e-135], t$95$0, If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 3.3e-20], N[(x / y), $MachinePrecision], If[LessEqual[y, 3.4e+27], 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{y}{x} \cdot \frac{1}{x}\\
\mathbf{if}\;y \leq -9.4 \cdot 10^{-135}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+27}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.39999999999999952e-135 or 3.3e-20 < y < 3.4e27

    1. Initial program 70.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. associate-+r+70.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
    5. Taylor expanded in y around 0 44.1%

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

    if -9.39999999999999952e-135 < y < 3.89999999999999999e-200

    1. Initial program 58.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 3.3e-20

    1. Initial program 82.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. associate-*l*82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4e27 < y

    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. associate-*l*59.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.4 \cdot 10^{-135}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-20}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+27}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 12: 81.3% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \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
 (if (<= y 3.9e-200)
   (/ (/ y (+ x 1.0)) x)
   (if (<= y 1.05e-134)
     (/ x y)
     (if (<= y 5e-95)
       (/ y (* x (+ x 1.0)))
       (if (<= y 8.2e+154) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y)))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 8.2e+154) {
		tmp = x / (y * (y + 1.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) :: tmp
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = x / y
    else if (y <= 5d-95) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 8.2d+154) then
        tmp = x / (y * (y + 1.0d0))
    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 tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / y;
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 8.2e+154) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = x / y
	elif y <= 5e-95:
		tmp = y / (x * (x + 1.0))
	elif y <= 8.2e+154:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = Float64(x / y);
	elseif (y <= 5e-95)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 8.2e+154)
		tmp = Float64(x / Float64(y * Float64(y + 1.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)
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = x / y;
	elseif (y <= 5e-95)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 8.2e+154)
		tmp = x / (y * (y + 1.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_] := If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / y), $MachinePrecision], If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+154], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-134 < y < 4.9999999999999998e-95

    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. associate-*l*86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-95 < y < 8.2e154

    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. associate-*l*71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2e154 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 13: 81.5% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 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 (<= y 3.9e-200)
   (/ (/ y (+ x 1.0)) x)
   (if (<= y 1.05e-134)
     (/ x (* y (+ y (+ x 1.0))))
     (if (<= y 5e-95) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ x (+ y 1.0)))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / (y * (y + (x + 1.0)));
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (x + (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 (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = x / (y * (y + (x + 1.0d0)))
    else if (y <= 5d-95) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / y) / (x + (y + 1.0d0))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / (y * (y + (x + 1.0)));
	} else if (y <= 5e-95) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (x + (y + 1.0));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = x / (y * (y + (x + 1.0)))
	elif y <= 5e-95:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / y) / (x + (y + 1.0))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = Float64(x / Float64(y * Float64(y + Float64(x + 1.0))));
	elseif (y <= 5e-95)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / y) / Float64(x + Float64(y + 1.0)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = x / (y * (y + (x + 1.0)));
	elseif (y <= 5e-95)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / y) / (x + (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[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / N[(y * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-134 < y < 4.9999999999999998e-95

    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. associate-*l*86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-95 < y

    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. associate-*l*67.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.6%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 65.8%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. *-commutative65.8%

        \[\leadsto \color{blue}{\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}} \]
      2. associate-+r+65.8%

        \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) + 1}} \cdot \frac{1}{y} \]
      3. +-commutative65.8%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} + 1} \cdot \frac{1}{y} \]
      4. associate-+r+65.8%

        \[\leadsto \frac{x}{\color{blue}{y + \left(x + 1\right)}} \cdot \frac{1}{y} \]
      5. frac-times63.9%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
      6. *-rgt-identity63.9%

        \[\leadsto \frac{\color{blue}{x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
    6. Applied egg-rr63.9%

      \[\leadsto \color{blue}{\frac{x}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity63.9%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
      2. times-frac65.9%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{x}{y}} \]
      3. associate-+r+65.9%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{x}{y} \]
      4. +-commutative65.9%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{x}{y} \]
      5. associate-+l+65.9%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{x}{y} \]
    8. Applied egg-rr65.9%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{x}{y}} \]
    9. Step-by-step derivation
      1. associate-*l/65.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity65.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + \left(y + 1\right)} \]
    10. Simplified65.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{x + \left(y + 1\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]

Alternative 14: 81.5% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot t_0}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t_0}}{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 1.0))))
   (if (<= y 3.9e-200)
     (/ (/ y (+ x 1.0)) x)
     (if (<= y 1.05e-134)
       (/ x (* y t_0))
       (if (<= y 4.3e-95) (/ y (* x (+ x 1.0))) (/ (/ x t_0) y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / (y * t_0);
	} else if (y <= 4.3e-95) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / t_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) :: t_0
    real(8) :: tmp
    t_0 = y + (x + 1.0d0)
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = x / (y * t_0)
    else if (y <= 4.3d-95) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / t_0) / y
    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 tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = x / (y * t_0);
	} else if (y <= 4.3e-95) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / t_0) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = x / (y * t_0)
	elif y <= 4.3e-95:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / t_0) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = Float64(x / Float64(y * t_0));
	elseif (y <= 4.3e-95)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / t_0) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y + (x + 1.0);
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = x / (y * t_0);
	elseif (y <= 4.3e-95)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / t_0) / 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 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(x / N[(y * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.3e-95], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot t_0}\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative65.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac84.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative84.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative56.4%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity56.4%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{x \cdot \left(x + 1\right)} \]
      2. times-frac59.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    8. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    9. Step-by-step derivation
      1. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + 1}}{x}} \]
      2. *-lft-identity59.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x} \]
    10. Simplified59.3%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{x}} \]

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative70.0%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac92.1%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative92.1%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.1%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 32.5%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. *-commutative32.5%

        \[\leadsto \color{blue}{\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}} \]
      2. associate-+r+32.5%

        \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) + 1}} \cdot \frac{1}{y} \]
      3. +-commutative32.5%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} + 1} \cdot \frac{1}{y} \]
      4. associate-+r+32.5%

        \[\leadsto \frac{x}{\color{blue}{y + \left(x + 1\right)}} \cdot \frac{1}{y} \]
      5. frac-times32.8%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
      6. *-rgt-identity32.8%

        \[\leadsto \frac{\color{blue}{x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
    6. Applied egg-rr32.8%

      \[\leadsto \color{blue}{\frac{x}{\left(y + \left(x + 1\right)\right) \cdot y}} \]

    if 1.05e-134 < y < 4.29999999999999997e-95

    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. associate-*l*86.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative86.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative86.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative86.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*86.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative86.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac99.8%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative99.8%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative99.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative99.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+99.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 77.2%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative77.2%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified77.2%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 4.29999999999999997e-95 < y

    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. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative67.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac92.6%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative92.6%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.6%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 65.8%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/65.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{x + \left(y + 1\right)}}{y}} \]
      2. *-un-lft-identity65.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{x + \left(y + 1\right)}}}{y} \]
      3. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{y} \]
      4. +-commutative65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{y} \]
      5. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr65.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-95}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\ \end{array} \]

Alternative 15: 81.5% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y + \left(x + 1\right)\\ \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot t_0}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t_0}}{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 1.0))))
   (if (<= y 3.9e-200)
     (/ (/ y (+ x 1.0)) x)
     (if (<= y 1.3e-134)
       (/ x (* y t_0))
       (if (<= y 5e-95) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x t_0) y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y + (x + 1.0);
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.3e-134) {
		tmp = x / (y * t_0);
	} else if (y <= 5e-95) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = (x / t_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) :: t_0
    real(8) :: tmp
    t_0 = y + (x + 1.0d0)
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.3d-134) then
        tmp = x / (y * t_0)
    else if (y <= 5d-95) then
        tmp = (y / (y + x)) / (x + 1.0d0)
    else
        tmp = (x / t_0) / y
    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 tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.3e-134) {
		tmp = x / (y * t_0);
	} else if (y <= 5e-95) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = (x / t_0) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y + (x + 1.0)
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.3e-134:
		tmp = x / (y * t_0)
	elif y <= 5e-95:
		tmp = (y / (y + x)) / (x + 1.0)
	else:
		tmp = (x / t_0) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y + Float64(x + 1.0))
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.3e-134)
		tmp = Float64(x / Float64(y * t_0));
	elseif (y <= 5e-95)
		tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / t_0) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y + (x + 1.0);
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.3e-134)
		tmp = x / (y * t_0);
	elseif (y <= 5e-95)
		tmp = (y / (y + x)) / (x + 1.0);
	else
		tmp = (x / t_0) / 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 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.3e-134], N[(x / N[(y * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y + \left(x + 1\right)\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-134}:\\
\;\;\;\;\frac{x}{y \cdot t_0}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative65.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac84.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative84.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative56.4%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity56.4%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{x \cdot \left(x + 1\right)} \]
      2. times-frac59.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    8. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    9. Step-by-step derivation
      1. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + 1}}{x}} \]
      2. *-lft-identity59.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x} \]
    10. Simplified59.3%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{x}} \]

    if 3.89999999999999999e-200 < y < 1.30000000000000011e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative70.0%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*70.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative70.0%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac92.1%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative92.1%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+92.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.1%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 32.5%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. *-commutative32.5%

        \[\leadsto \color{blue}{\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}} \]
      2. associate-+r+32.5%

        \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) + 1}} \cdot \frac{1}{y} \]
      3. +-commutative32.5%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} + 1} \cdot \frac{1}{y} \]
      4. associate-+r+32.5%

        \[\leadsto \frac{x}{\color{blue}{y + \left(x + 1\right)}} \cdot \frac{1}{y} \]
      5. frac-times32.8%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
      6. *-rgt-identity32.8%

        \[\leadsto \frac{\color{blue}{x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
    6. Applied egg-rr32.8%

      \[\leadsto \color{blue}{\frac{x}{\left(y + \left(x + 1\right)\right) \cdot y}} \]

    if 1.30000000000000011e-134 < y < 4.9999999999999998e-95

    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. associate-+r+86.1%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      2. *-commutative86.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
      3. frac-times99.8%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      4. associate-*l/86.1%

        \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      5. times-frac100.0%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      6. associate-+r+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      7. +-commutative100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      8. associate-+l+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    4. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}}} \]
      3. +-commutative100.0%

        \[\leadsto \frac{\frac{y}{\color{blue}{y + x}}}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}} \]
      4. div-inv99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{\left(x + y\right) \cdot \frac{1}{\frac{x}{y + \left(x + 1\right)}}}} \]
      5. clear-num99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\left(x + y\right) \cdot \color{blue}{\frac{y + \left(x + 1\right)}{x}}} \]
      6. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{\left(y + x\right)} \cdot \frac{y + \left(x + 1\right)}{x}} \]
    5. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{y + \left(x + 1\right)}{x}}} \]
    6. Taylor expanded in y around 0 77.7%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{1 + x}} \]
    7. Step-by-step derivation
      1. +-commutative77.7%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]
    8. Simplified77.7%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]

    if 4.9999999999999998e-95 < y

    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. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative67.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac92.6%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative92.6%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.6%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 65.8%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/65.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{x + \left(y + 1\right)}}{y}} \]
      2. *-un-lft-identity65.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{x + \left(y + 1\right)}}}{y} \]
      3. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{y} \]
      4. +-commutative65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{y} \]
      5. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr65.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-134}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\ \end{array} \]

Alternative 16: 81.6% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + \left(x + 1\right)}\\ \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{t_0}{y + x}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{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 (/ x (+ y (+ x 1.0)))))
   (if (<= y 3.9e-200)
     (/ (/ y (+ x 1.0)) x)
     (if (<= y 1.05e-134)
       (/ t_0 (+ y x))
       (if (<= y 5e-95) (/ (/ y (+ y x)) (+ x 1.0)) (/ t_0 y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x / (y + (x + 1.0));
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = t_0 / (y + x);
	} else if (y <= 5e-95) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = t_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) :: t_0
    real(8) :: tmp
    t_0 = x / (y + (x + 1.0d0))
    if (y <= 3.9d-200) then
        tmp = (y / (x + 1.0d0)) / x
    else if (y <= 1.05d-134) then
        tmp = t_0 / (y + x)
    else if (y <= 5d-95) then
        tmp = (y / (y + x)) / (x + 1.0d0)
    else
        tmp = t_0 / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = x / (y + (x + 1.0));
	double tmp;
	if (y <= 3.9e-200) {
		tmp = (y / (x + 1.0)) / x;
	} else if (y <= 1.05e-134) {
		tmp = t_0 / (y + x);
	} else if (y <= 5e-95) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = t_0 / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x / (y + (x + 1.0))
	tmp = 0
	if y <= 3.9e-200:
		tmp = (y / (x + 1.0)) / x
	elif y <= 1.05e-134:
		tmp = t_0 / (y + x)
	elif y <= 5e-95:
		tmp = (y / (y + x)) / (x + 1.0)
	else:
		tmp = t_0 / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(x / Float64(y + Float64(x + 1.0)))
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / x);
	elseif (y <= 1.05e-134)
		tmp = Float64(t_0 / Float64(y + x));
	elseif (y <= 5e-95)
		tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0));
	else
		tmp = Float64(t_0 / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = x / (y + (x + 1.0));
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = (y / (x + 1.0)) / x;
	elseif (y <= 1.05e-134)
		tmp = t_0 / (y + x);
	elseif (y <= 5e-95)
		tmp = (y / (y + x)) / (x + 1.0);
	else
		tmp = t_0 / 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[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.9e-200], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 1.05e-134], N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-95], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / y), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{x}{y + \left(x + 1\right)}\\
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\
\;\;\;\;\frac{t_0}{y + x}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative65.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac84.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative84.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative56.4%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity56.4%

        \[\leadsto \frac{\color{blue}{1 \cdot y}}{x \cdot \left(x + 1\right)} \]
      2. times-frac59.2%

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    8. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    9. Step-by-step derivation
      1. associate-*l/59.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + 1}}{x}} \]
      2. *-lft-identity59.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x} \]
    10. Simplified59.3%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + 1}}{x}} \]

    if 3.89999999999999999e-200 < y < 1.05e-134

    1. Initial program 70.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-+r+70.0%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      2. *-commutative70.0%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
      3. frac-times92.1%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      4. associate-*l/70.0%

        \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      5. times-frac100.0%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      6. associate-+r+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      7. +-commutative100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      8. associate-+l+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    4. Taylor expanded in y around inf 34.4%

      \[\leadsto \color{blue}{1} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y} \]

    if 1.05e-134 < y < 4.9999999999999998e-95

    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. associate-+r+86.1%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      2. *-commutative86.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
      3. frac-times99.8%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      4. associate-*l/86.1%

        \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      5. times-frac100.0%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      6. associate-+r+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      7. +-commutative100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      8. associate-+l+100.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    3. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    4. Step-by-step derivation
      1. clear-num100.0%

        \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}}} \]
      2. un-div-inv100.0%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}}} \]
      3. +-commutative100.0%

        \[\leadsto \frac{\frac{y}{\color{blue}{y + x}}}{\frac{x + y}{\frac{x}{y + \left(x + 1\right)}}} \]
      4. div-inv99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{\left(x + y\right) \cdot \frac{1}{\frac{x}{y + \left(x + 1\right)}}}} \]
      5. clear-num99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\left(x + y\right) \cdot \color{blue}{\frac{y + \left(x + 1\right)}{x}}} \]
      6. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{\left(y + x\right)} \cdot \frac{y + \left(x + 1\right)}{x}} \]
    5. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{y + \left(x + 1\right)}{x}}} \]
    6. Taylor expanded in y around 0 77.7%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{1 + x}} \]
    7. Step-by-step derivation
      1. +-commutative77.7%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]
    8. Simplified77.7%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]

    if 4.9999999999999998e-95 < y

    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. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative67.1%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*67.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative67.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac92.6%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative92.6%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+92.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.6%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 65.8%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/65.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{x + \left(y + 1\right)}}{y}} \]
      2. *-un-lft-identity65.9%

        \[\leadsto \frac{\color{blue}{\frac{x}{x + \left(y + 1\right)}}}{y} \]
      3. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{y} \]
      4. +-commutative65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{y} \]
      5. associate-+r+65.9%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr65.9%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-134}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y + x}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-95}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\ \end{array} \]

Alternative 17: 68.9% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{y \cdot x}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 4.6:\\ \;\;\;\;\frac{x}{y} - x\\ \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
 (if (<= y -1.2e+41)
   (/ x (* y x))
   (if (<= y 3.4e-200)
     (/ y x)
     (if (<= y 4.6) (- (/ x y) x) (* (/ 1.0 y) (/ x y))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= -1.2e+41) {
		tmp = x / (y * x);
	} else if (y <= 3.4e-200) {
		tmp = y / x;
	} else if (y <= 4.6) {
		tmp = (x / y) - x;
	} 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) :: tmp
    if (y <= (-1.2d+41)) then
        tmp = x / (y * x)
    else if (y <= 3.4d-200) then
        tmp = y / x
    else if (y <= 4.6d0) then
        tmp = (x / y) - x
    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 tmp;
	if (y <= -1.2e+41) {
		tmp = x / (y * x);
	} else if (y <= 3.4e-200) {
		tmp = y / x;
	} else if (y <= 4.6) {
		tmp = (x / y) - x;
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= -1.2e+41:
		tmp = x / (y * x)
	elif y <= 3.4e-200:
		tmp = y / x
	elif y <= 4.6:
		tmp = (x / y) - x
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= -1.2e+41)
		tmp = Float64(x / Float64(y * x));
	elseif (y <= 3.4e-200)
		tmp = Float64(y / x);
	elseif (y <= 4.6)
		tmp = Float64(Float64(x / y) - x);
	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)
	tmp = 0.0;
	if (y <= -1.2e+41)
		tmp = x / (y * x);
	elseif (y <= 3.4e-200)
		tmp = y / x;
	elseif (y <= 4.6)
		tmp = (x / y) - x;
	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_] := If[LessEqual[y, -1.2e+41], N[(x / N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 4.6], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y \cdot x}\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 4.6:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.2000000000000001e41

    1. Initial program 56.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. associate-*l*56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative56.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac86.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative86.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 68.4%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. *-commutative68.4%

        \[\leadsto \color{blue}{\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}} \]
      2. associate-+r+68.4%

        \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) + 1}} \cdot \frac{1}{y} \]
      3. +-commutative68.4%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} + 1} \cdot \frac{1}{y} \]
      4. associate-+r+68.4%

        \[\leadsto \frac{x}{\color{blue}{y + \left(x + 1\right)}} \cdot \frac{1}{y} \]
      5. frac-times81.9%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
      6. *-rgt-identity81.9%

        \[\leadsto \frac{\color{blue}{x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
    6. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\frac{x}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
    7. Taylor expanded in x around inf 27.6%

      \[\leadsto \frac{x}{\color{blue}{x \cdot y}} \]

    if -1.2000000000000001e41 < y < 3.4000000000000003e-200

    1. Initial program 70.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. associate-*l*70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative70.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac83.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative83.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified83.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 70.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative70.9%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified70.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Taylor expanded in x around 0 50.8%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 3.4000000000000003e-200 < y < 4.5999999999999996

    1. Initial program 83.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. associate-*l*83.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative83.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative83.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative83.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*83.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative83.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac97.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative97.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative97.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative97.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+97.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified97.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 34.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative34.3%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified34.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 34.3%

      \[\leadsto \color{blue}{-1 \cdot x + \frac{x}{y}} \]
    8. Step-by-step derivation
      1. neg-mul-134.3%

        \[\leadsto \color{blue}{\left(-x\right)} + \frac{x}{y} \]
      2. +-commutative34.3%

        \[\leadsto \color{blue}{\frac{x}{y} + \left(-x\right)} \]
      3. unsub-neg34.3%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified34.3%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 4.5999999999999996 < y

    1. Initial program 59.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. associate-*l*59.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative59.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative59.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative59.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*59.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative59.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac90.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative90.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative90.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative90.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+90.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 74.4%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Taylor expanded in y around inf 73.9%

      \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification50.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{y \cdot x}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 4.6:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 18: 76.4% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-135}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \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
 (if (<= y -2.05e-135)
   (* (/ y x) (/ 1.0 x))
   (if (<= y 3.9e-200)
     (/ y x)
     (if (<= y 1.2e+155) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= -2.05e-135) {
		tmp = (y / x) * (1.0 / x);
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else if (y <= 1.2e+155) {
		tmp = x / (y * (y + 1.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) :: tmp
    if (y <= (-2.05d-135)) then
        tmp = (y / x) * (1.0d0 / x)
    else if (y <= 3.9d-200) then
        tmp = y / x
    else if (y <= 1.2d+155) then
        tmp = x / (y * (y + 1.0d0))
    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 tmp;
	if (y <= -2.05e-135) {
		tmp = (y / x) * (1.0 / x);
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else if (y <= 1.2e+155) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= -2.05e-135:
		tmp = (y / x) * (1.0 / x)
	elif y <= 3.9e-200:
		tmp = y / x
	elif y <= 1.2e+155:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= -2.05e-135)
		tmp = Float64(Float64(y / x) * Float64(1.0 / x));
	elseif (y <= 3.9e-200)
		tmp = Float64(y / x);
	elseif (y <= 1.2e+155)
		tmp = Float64(x / Float64(y * Float64(y + 1.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)
	tmp = 0.0;
	if (y <= -2.05e-135)
		tmp = (y / x) * (1.0 / x);
	elseif (y <= 3.9e-200)
		tmp = y / x;
	elseif (y <= 1.2e+155)
		tmp = x / (y * (y + 1.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_] := If[LessEqual[y, -2.05e-135], N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.2e+155], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{-135}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.05000000000000005e-135

    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. associate-+r+70.6%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      2. *-commutative70.6%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
      3. frac-times92.5%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      4. associate-*l/88.6%

        \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      5. times-frac99.8%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      6. associate-+r+99.8%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      7. +-commutative99.8%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      8. associate-+l+99.8%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    4. Taylor expanded in x around inf 41.6%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
    5. Taylor expanded in y around 0 41.0%

      \[\leadsto \color{blue}{\frac{y}{x}} \cdot \frac{1}{x} \]

    if -2.05000000000000005e-135 < y < 3.89999999999999999e-200

    1. Initial program 58.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*58.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative58.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative58.8%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative58.8%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*58.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative58.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac71.8%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative71.8%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative71.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative71.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+71.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified71.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 86.3%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative86.3%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified86.3%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Taylor expanded in x around 0 80.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 3.89999999999999999e-200 < y < 1.2000000000000001e155

    1. Initial program 72.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. associate-*l*72.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative72.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative72.7%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative72.7%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*72.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative72.7%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac95.2%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative95.2%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative95.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative95.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+95.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 42.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative42.4%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified42.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 1.2000000000000001e155 < y

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*59.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative59.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative59.8%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative59.8%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*59.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative59.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac88.2%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative88.2%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative88.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative88.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+88.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified88.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 96.0%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Taylor expanded in y around inf 96.0%

      \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{-135}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 19: 46.0% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{y \cdot x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\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
 (if (<= y -1.2e+41) (/ x (* y x)) (if (<= y 3.9e-200) (/ y x) (/ x y))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= -1.2e+41) {
		tmp = x / (y * x);
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else {
		tmp = 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) :: tmp
    if (y <= (-1.2d+41)) then
        tmp = x / (y * x)
    else if (y <= 3.9d-200) then
        tmp = y / x
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= -1.2e+41) {
		tmp = x / (y * x);
	} else if (y <= 3.9e-200) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= -1.2e+41:
		tmp = x / (y * x)
	elif y <= 3.9e-200:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= -1.2e+41)
		tmp = Float64(x / Float64(y * x));
	elseif (y <= 3.9e-200)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -1.2e+41)
		tmp = x / (y * x);
	elseif (y <= 3.9e-200)
		tmp = y / x;
	else
		tmp = x / 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, -1.2e+41], N[(x / N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.9e-200], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{y \cdot x}\\

\mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.2000000000000001e41

    1. Initial program 56.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. associate-*l*56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative56.3%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*56.3%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative56.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac86.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative86.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 68.4%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. *-commutative68.4%

        \[\leadsto \color{blue}{\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}} \]
      2. associate-+r+68.4%

        \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) + 1}} \cdot \frac{1}{y} \]
      3. +-commutative68.4%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} + 1} \cdot \frac{1}{y} \]
      4. associate-+r+68.4%

        \[\leadsto \frac{x}{\color{blue}{y + \left(x + 1\right)}} \cdot \frac{1}{y} \]
      5. frac-times81.9%

        \[\leadsto \color{blue}{\frac{x \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
      6. *-rgt-identity81.9%

        \[\leadsto \frac{\color{blue}{x}}{\left(y + \left(x + 1\right)\right) \cdot y} \]
    6. Applied egg-rr81.9%

      \[\leadsto \color{blue}{\frac{x}{\left(y + \left(x + 1\right)\right) \cdot y}} \]
    7. Taylor expanded in x around inf 27.6%

      \[\leadsto \frac{x}{\color{blue}{x \cdot y}} \]

    if -1.2000000000000001e41 < y < 3.89999999999999999e-200

    1. Initial program 70.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. associate-*l*70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative70.4%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*70.4%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative70.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac83.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative83.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+83.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified83.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 70.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative70.9%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified70.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Taylor expanded in x around 0 50.8%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 3.89999999999999999e-200 < y

    1. Initial program 68.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. associate-*l*68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative68.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac93.0%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative93.0%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified93.0%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 57.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified57.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 29.4%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification37.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{y \cdot x}\\ \mathbf{elif}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 20: 44.1% accurate, 3.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\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 (if (<= y 3.9e-200) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = y / x;
	} else {
		tmp = 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) :: tmp
    if (y <= 3.9d-200) then
        tmp = y / x
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.9e-200) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.9e-200:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.9e-200)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3.9e-200)
		tmp = y / x;
	else
		tmp = x / 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, 3.9e-200], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.89999999999999999e-200

    1. Initial program 65.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. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative65.9%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*65.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative65.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac84.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative84.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+84.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. +-commutative56.4%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    6. Simplified56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    7. Taylor expanded in x around 0 35.4%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 3.89999999999999999e-200 < y

    1. Initial program 68.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. associate-*l*68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      2. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      3. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      4. +-commutative68.5%

        \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      5. associate-*l*68.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. *-commutative68.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      7. times-frac93.0%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative93.0%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. +-commutative93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      11. associate-+l+93.0%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified93.0%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 57.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified57.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 29.4%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.9 \cdot 10^{-200}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 21: 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 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. associate-+r+67.1%

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    2. *-commutative67.1%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
    3. frac-times88.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. associate-*l/81.8%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    5. times-frac99.8%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
    6. associate-+r+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
    7. +-commutative99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
    8. associate-+l+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
  3. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
  4. Taylor expanded in x around inf 40.6%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
  5. Taylor expanded in y around inf 4.4%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  6. Final simplification4.4%

    \[\leadsto \frac{1}{x} \]

Alternative 22: 4.1% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{1}{y} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ 1.0 y))
assert(x < y);
double code(double x, double y) {
	return 1.0 / y;
}
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 / y
end function
assert x < y;
public static double code(double x, double y) {
	return 1.0 / y;
}
[x, y] = sort([x, y])
def code(x, y):
	return 1.0 / y
x, y = sort([x, y])
function code(x, y)
	return Float64(1.0 / y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = 1.0 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{1}{y}
\end{array}
Derivation
  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. associate-*l*67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
    2. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
    3. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
    4. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
    5. associate-*l*67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
    6. *-commutative67.1%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
    7. times-frac88.2%

      \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
    8. +-commutative88.2%

      \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
    9. +-commutative88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
    10. +-commutative88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
    11. associate-+l+88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified88.2%

    \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in y around inf 50.0%

    \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
  5. Taylor expanded in x around inf 4.3%

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  6. Final simplification4.3%

    \[\leadsto \frac{1}{y} \]

Alternative 23: 26.6% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{x}{y} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
	return x / y;
}
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 = x / y
end function
assert x < y;
public static double code(double x, double y) {
	return x / y;
}
[x, y] = sort([x, y])
def code(x, y):
	return x / y
x, y = sort([x, y])
function code(x, y)
	return Float64(x / y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Derivation
  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. associate-*l*67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
    2. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
    3. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
    4. +-commutative67.1%

      \[\leadsto \frac{x \cdot y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
    5. associate-*l*67.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
    6. *-commutative67.1%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \]
    7. times-frac88.2%

      \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
    8. +-commutative88.2%

      \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
    9. +-commutative88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
    10. +-commutative88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
    11. associate-+l+88.2%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified88.2%

    \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in x around 0 50.9%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  5. Step-by-step derivation
    1. +-commutative50.9%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
  6. Simplified50.9%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  7. Taylor expanded in y around 0 25.9%

    \[\leadsto \frac{x}{\color{blue}{y}} \]
  8. Final simplification25.9%

    \[\leadsto \frac{x}{y} \]

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 2023322 
(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))))