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

Percentage Accurate: 68.7% → 99.3%
Time: 18.8s
Alternatives: 24
Speedup: 1.9×

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 24 alternatives:

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

Initial Program: 68.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.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{y + \left(x + 1\right)}{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)) (* (+ y x) (/ (+ y (+ x 1.0)) x))))
assert(x < y);
double code(double x, double y) {
	return (y / (y + x)) / ((y + x) * ((y + (x + 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 = (y / (y + x)) / ((y + x) * ((y + (x + 1.0d0)) / x))
end function
assert x < y;
public static double code(double x, double y) {
	return (y / (y + x)) / ((y + x) * ((y + (x + 1.0)) / x));
}
[x, y] = sort([x, y])
def code(x, y):
	return (y / (y + x)) / ((y + x) * ((y + (x + 1.0)) / x))
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(y + Float64(x + 1.0)) / x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = (y / (y + x)) / ((y + x) * ((y + (x + 1.0)) / 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[(y + x), $MachinePrecision] * N[(N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{y + \left(x + 1\right)}{x}}
\end{array}
Derivation
  1. Initial program 72.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*72.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. +-commutative72.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. +-commutative72.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. +-commutative72.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*72.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. *-commutative72.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. associate-*r/84.7%

      \[\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. *-commutative84.7%

      \[\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-in67.1%

      \[\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-def84.7%

      \[\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. +-commutative84.7%

      \[\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. +-commutative84.7%

      \[\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-unmult84.7%

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

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

    \[\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. associate-*r/72.3%

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

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

      \[\leadsto \frac{y \cdot 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)}} \]
    4. distribute-rgt1-in72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 75.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*75.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. +-commutative75.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. +-commutative75.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. +-commutative75.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*75.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. *-commutative75.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. associate-*r/87.7%

        \[\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. *-commutative87.7%

        \[\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-in66.4%

        \[\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-def87.7%

        \[\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. +-commutative87.7%

        \[\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. +-commutative87.7%

        \[\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-unmult87.7%

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

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

      \[\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. associate-*r/75.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative75.9%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{x + 1}{y}}}{y + x}} \cdot \frac{x}{y + x} \]
      4. clear-num85.8%

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

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

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

    if 2e-19 < y < 3.79999999999999966e153

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.8%

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

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

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

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

    if 3.79999999999999966e153 < y

    1. Initial program 58.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*58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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*58.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. *-commutative58.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. associate-*r/75.9%

        \[\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. *-commutative75.9%

        \[\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-in75.8%

        \[\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-def75.9%

        \[\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. +-commutative75.9%

        \[\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. +-commutative75.9%

        \[\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-unmult75.9%

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

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

      \[\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. associate-*r/58.5%

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult58.5%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 75.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*75.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. +-commutative75.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. +-commutative75.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. +-commutative75.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*75.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. *-commutative75.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. associate-*r/87.7%

        \[\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. *-commutative87.7%

        \[\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-in66.4%

        \[\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-def87.7%

        \[\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. +-commutative87.7%

        \[\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. +-commutative87.7%

        \[\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-unmult87.7%

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

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

      \[\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. associate-*r/75.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative75.9%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{\frac{x + 1}{y}}}{y + x}} \cdot \frac{x}{y + x} \]
      4. clear-num85.8%

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

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

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

    if 4.39999999999999982e-20 < y < 1.35000000000000003e154

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*64.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. +-commutative64.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. +-commutative64.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. +-commutative64.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. *-commutative64.6%

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < y

    1. Initial program 58.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*58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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*58.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. *-commutative58.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. associate-*r/75.9%

        \[\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. *-commutative75.9%

        \[\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-in75.8%

        \[\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-def75.9%

        \[\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. +-commutative75.9%

        \[\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. +-commutative75.9%

        \[\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-unmult75.9%

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

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

      \[\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. associate-*r/58.5%

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult58.5%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 90.5% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.0499999999999999e-10

    1. Initial program 64.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*64.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. +-commutative64.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. +-commutative64.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. +-commutative64.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*64.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. *-commutative64.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. associate-*r/79.7%

        \[\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. *-commutative79.7%

        \[\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-in31.7%

        \[\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-def79.7%

        \[\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. +-commutative79.7%

        \[\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. +-commutative79.7%

        \[\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-unmult79.7%

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

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

      \[\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. associate-*r/64.1%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in64.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. mul-1-neg81.6%

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999999e-10 < x < -6.49999999999999996e-179

    1. Initial program 81.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.7%

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

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

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

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

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

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

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

    if -6.49999999999999996e-179 < x < -2.20000000000000009e-231

    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. associate-*r/80.2%

        \[\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. *-commutative80.2%

        \[\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-in71.1%

        \[\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-def80.2%

        \[\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. +-commutative80.2%

        \[\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. +-commutative80.2%

        \[\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-unmult80.2%

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

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

      \[\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. associate-*r/72.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative72.7%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult63.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000009e-231 < x

    1. Initial program 73.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*73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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*73.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. *-commutative73.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. associate-*r/85.0%

        \[\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. *-commutative85.0%

        \[\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-in77.2%

        \[\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-def85.0%

        \[\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. +-commutative85.0%

        \[\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. +-commutative85.0%

        \[\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-unmult85.0%

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

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

      \[\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. associate-*r/73.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative73.7%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*64.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. +-commutative64.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. +-commutative64.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. +-commutative64.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*64.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. *-commutative64.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. associate-*r/80.0%

        \[\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. *-commutative80.0%

        \[\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-in31.2%

        \[\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-def80.0%

        \[\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. +-commutative80.0%

        \[\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. +-commutative80.0%

        \[\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-unmult80.0%

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

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

      \[\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. associate-*r/64.6%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001e-14 < x < -2.20000000000000009e-231

    1. Initial program 78.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*78.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. +-commutative78.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. +-commutative78.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. +-commutative78.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*78.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. *-commutative78.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. associate-*r/90.3%

        \[\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. *-commutative90.3%

        \[\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-in83.3%

        \[\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-def90.3%

        \[\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. +-commutative90.3%

        \[\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. +-commutative90.3%

        \[\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-unmult90.3%

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

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

      \[\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. associate-*r/78.5%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000009e-231 < x

    1. Initial program 73.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*73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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*73.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. *-commutative73.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. associate-*r/85.0%

        \[\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. *-commutative85.0%

        \[\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-in77.2%

        \[\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-def85.0%

        \[\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. +-commutative85.0%

        \[\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. +-commutative85.0%

        \[\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-unmult85.0%

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

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

      \[\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. associate-*r/73.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative73.7%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 86.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*64.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. +-commutative64.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. +-commutative64.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. +-commutative64.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*64.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. *-commutative64.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. associate-*r/80.0%

        \[\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. *-commutative80.0%

        \[\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-in31.2%

        \[\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-def80.0%

        \[\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. +-commutative80.0%

        \[\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. +-commutative80.0%

        \[\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-unmult80.0%

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

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

      \[\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. associate-*r/64.6%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999991e-14 < x < -1.7e-231

    1. Initial program 78.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*78.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. +-commutative78.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. +-commutative78.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. +-commutative78.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*78.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. *-commutative78.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. associate-*r/90.3%

        \[\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. *-commutative90.3%

        \[\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-in83.3%

        \[\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-def90.3%

        \[\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. +-commutative90.3%

        \[\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. +-commutative90.3%

        \[\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-unmult90.3%

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

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

      \[\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. associate-*r/78.5%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e-231 < x

    1. Initial program 73.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*73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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*73.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. *-commutative73.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. associate-*r/85.0%

        \[\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. *-commutative85.0%

        \[\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-in77.2%

        \[\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-def85.0%

        \[\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. +-commutative85.0%

        \[\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. +-commutative85.0%

        \[\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-unmult85.0%

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

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

      \[\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. associate-*r/73.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative73.7%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.8% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*64.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. +-commutative64.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. +-commutative64.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. +-commutative64.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*64.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. *-commutative64.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. associate-*r/80.0%

        \[\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. *-commutative80.0%

        \[\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-in31.2%

        \[\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-def80.0%

        \[\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. +-commutative80.0%

        \[\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. +-commutative80.0%

        \[\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-unmult80.0%

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

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

      \[\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. associate-*r/64.6%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in64.6%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(y + x\right)}} \]
    6. Taylor expanded in x around -inf 80.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. mul-1-neg80.5%

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999998e-16 < x < -1.79999999999999987e-231

    1. Initial program 78.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*78.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. +-commutative78.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. +-commutative78.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. +-commutative78.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*78.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. *-commutative78.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. associate-*r/90.3%

        \[\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. *-commutative90.3%

        \[\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-in83.3%

        \[\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-def90.3%

        \[\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. +-commutative90.3%

        \[\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. +-commutative90.3%

        \[\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-unmult90.3%

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

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

      \[\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. associate-*r/78.5%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.79999999999999987e-231 < x

    1. Initial program 73.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*73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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*73.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. *-commutative73.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. associate-*r/85.0%

        \[\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. *-commutative85.0%

        \[\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-in77.2%

        \[\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-def85.0%

        \[\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. +-commutative85.0%

        \[\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. +-commutative85.0%

        \[\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-unmult85.0%

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

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

      \[\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. associate-*r/73.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative73.7%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 91.6% accurate, 1.0× speedup?

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

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


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

    1. Initial program 76.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*76.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. +-commutative76.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. +-commutative76.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. +-commutative76.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*76.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. *-commutative76.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. associate-*r/87.7%

        \[\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. *-commutative87.7%

        \[\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-in66.8%

        \[\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-def87.7%

        \[\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. +-commutative87.7%

        \[\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. +-commutative87.7%

        \[\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-unmult87.8%

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

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

      \[\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. associate-*r/76.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative76.4%

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{y + x} \cdot \frac{x}{y + x} \]
      5. +-commutative86.1%

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

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

    if 7.49999999999999945e29 < y

    1. Initial program 57.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*57.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. +-commutative57.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. +-commutative57.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. +-commutative57.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*57.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. *-commutative57.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. associate-*r/73.7%

        \[\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. *-commutative73.7%

        \[\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-in68.0%

        \[\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-def73.7%

        \[\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. +-commutative73.7%

        \[\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. +-commutative73.7%

        \[\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-unmult73.7%

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

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

      \[\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. associate-*r/57.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative57.8%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult57.8%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.2% accurate, 1.0× speedup?

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

      \[\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. *-commutative84.7%

      \[\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-in67.1%

      \[\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-def84.7%

      \[\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. +-commutative84.7%

      \[\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. +-commutative84.7%

      \[\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-unmult84.7%

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

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

    \[\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. associate-*r/72.3%

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. cube-mult57.5%

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    5. distribute-rgt1-in72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 81.5% accurate, 1.3× speedup?

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{y}{x} - y\\

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

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


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

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*63.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. +-commutative63.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. +-commutative63.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. +-commutative63.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*63.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. *-commutative63.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. associate-*r/79.3%

        \[\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. *-commutative79.3%

        \[\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-in32.3%

        \[\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-def79.3%

        \[\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. +-commutative79.3%

        \[\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. +-commutative79.3%

        \[\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-unmult79.3%

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

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

      \[\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. associate-*r/63.5%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
    7. Taylor expanded in y around 0 80.6%

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

    if -1 < x < -8.4999999999999997e-98

    1. Initial program 80.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. times-frac99.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot y + \frac{y}{x}} \]
    8. Step-by-step derivation
      1. neg-mul-137.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    9. Simplified37.2%

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

    if -8.4999999999999997e-98 < x < 1.90000000000000004e-32

    1. Initial program 75.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. times-frac91.1%

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

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

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

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

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

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

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

    if 1.90000000000000004e-32 < x

    1. Initial program 72.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*72.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. +-commutative72.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. +-commutative72.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. +-commutative72.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. *-commutative72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 82.5% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

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

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

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

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

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

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

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

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

    if 1.8000000000000002e-170 < y < 1.35000000000000003e154

    1. Initial program 76.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*76.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. +-commutative76.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. +-commutative76.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. +-commutative76.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. *-commutative76.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < y

    1. Initial program 58.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*58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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*58.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. *-commutative58.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. associate-*r/75.9%

        \[\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. *-commutative75.9%

        \[\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-in75.8%

        \[\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-def75.9%

        \[\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. +-commutative75.9%

        \[\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. +-commutative75.9%

        \[\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-unmult75.9%

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

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

      \[\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. associate-*r/58.5%

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult58.5%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 75.0% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.7 \cdot 10^{-97}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-98}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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 (<= x -1.0)
   (/ (/ y x) x)
   (if (<= x -5.7e-97)
     (- (/ y x) y)
     (if (<= x 2.25e-98) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = (y / x) / x;
	} else if (x <= -5.7e-97) {
		tmp = (y / x) - y;
	} else if (x <= 2.25e-98) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.0d0)) then
        tmp = (y / x) / x
    else if (x <= (-5.7d-97)) then
        tmp = (y / x) - y
    else if (x <= 2.25d-98) then
        tmp = x / y
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = (y / x) / x;
	} else if (x <= -5.7e-97) {
		tmp = (y / x) - y;
	} else if (x <= 2.25e-98) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.0:
		tmp = (y / x) / x
	elif x <= -5.7e-97:
		tmp = (y / x) - y
	elif x <= 2.25e-98:
		tmp = x / y
	else:
		tmp = (x / y) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.0)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -5.7e-97)
		tmp = Float64(Float64(y / x) - y);
	elseif (x <= 2.25e-98)
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.0)
		tmp = (y / x) / x;
	elseif (x <= -5.7e-97)
		tmp = (y / x) - y;
	elseif (x <= 2.25e-98)
		tmp = x / y;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -5.7e-97], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 2.25e-98], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

\mathbf{elif}\;x \leq -5.7 \cdot 10^{-97}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq 2.25 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*63.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. +-commutative63.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. +-commutative63.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. +-commutative63.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*63.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. *-commutative63.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. associate-*r/79.3%

        \[\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. *-commutative79.3%

        \[\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-in32.3%

        \[\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-def79.3%

        \[\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. +-commutative79.3%

        \[\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. +-commutative79.3%

        \[\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-unmult79.3%

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

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

      \[\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. associate-*r/63.5%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
    7. Taylor expanded in y around 0 80.6%

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

    if -1 < x < -5.7000000000000001e-97

    1. Initial program 80.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. times-frac99.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot y + \frac{y}{x}} \]
    8. Step-by-step derivation
      1. neg-mul-137.2%

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    9. Simplified37.2%

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

    if -5.7000000000000001e-97 < x < 2.24999999999999998e-98

    1. Initial program 72.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

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

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

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

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

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

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

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

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

    if 2.24999999999999998e-98 < x

    1. Initial program 76.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*76.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. +-commutative76.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. +-commutative76.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. +-commutative76.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. *-commutative76.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -5.7 \cdot 10^{-97}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-98}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 13: 77.5% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+130}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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.8e-170)
   (/ y (* x (+ x 1.0)))
   (if (<= y 6.5e+130)
     (/ x (* y (+ y 1.0)))
     (if (<= y 1.66e+149) (/ (/ y x) x) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 6.5e+130) {
		tmp = x / (y * (y + 1.0));
	} else if (y <= 1.66e+149) {
		tmp = (y / x) / x;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.8d-170) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 6.5d+130) then
        tmp = x / (y * (y + 1.0d0))
    else if (y <= 1.66d+149) then
        tmp = (y / x) / x
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 6.5e+130) {
		tmp = x / (y * (y + 1.0));
	} else if (y <= 1.66e+149) {
		tmp = (y / x) / x;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 1.8e-170:
		tmp = y / (x * (x + 1.0))
	elif y <= 6.5e+130:
		tmp = x / (y * (y + 1.0))
	elif y <= 1.66e+149:
		tmp = (y / x) / x
	else:
		tmp = (x / y) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 1.8e-170)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 6.5e+130)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	elseif (y <= 1.66e+149)
		tmp = Float64(Float64(y / x) / x);
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.8e-170)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 6.5e+130)
		tmp = x / (y * (y + 1.0));
	elseif (y <= 1.66e+149)
		tmp = (y / x) / x;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 1.8e-170], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+130], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.66e+149], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

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

\mathbf{elif}\;y \leq 1.66 \cdot 10^{+149}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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


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

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

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

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

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

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

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

    if 1.8000000000000002e-170 < y < 6.5e130

    1. Initial program 83.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. times-frac92.1%

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

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

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

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

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

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

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

    if 6.5e130 < y < 1.6600000000000001e149

    1. Initial program 14.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*14.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. +-commutative14.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. +-commutative14.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. +-commutative14.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*14.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. *-commutative14.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. associate-*r/72.9%

        \[\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. *-commutative72.9%

        \[\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-in29.2%

        \[\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-def72.9%

        \[\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. +-commutative72.9%

        \[\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. +-commutative72.9%

        \[\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-unmult72.9%

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

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

      \[\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. associate-*r/14.9%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in14.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
    7. Taylor expanded in y around 0 73.2%

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

    if 1.6600000000000001e149 < y

    1. Initial program 58.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*58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.5%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 6.5 \cdot 10^{+130}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.66 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 14: 81.8% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 57.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*57.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. +-commutative57.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. +-commutative57.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. +-commutative57.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*57.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. *-commutative57.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. associate-*r/77.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. *-commutative77.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-in3.0%

        \[\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-def77.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. +-commutative77.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. +-commutative77.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-unmult77.4%

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

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

      \[\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. associate-*r/57.9%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
    7. Taylor expanded in y around 0 87.6%

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

    if -1.64999999999999996e171 < x < -5.4999999999999997e-98

    1. Initial program 76.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. times-frac93.0%

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

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

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

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

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

    if -5.4999999999999997e-98 < x

    1. Initial program 74.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*74.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. +-commutative74.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. +-commutative74.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. +-commutative74.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*74.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. *-commutative74.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. associate-*r/85.3%

        \[\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. *-commutative85.3%

        \[\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-in77.5%

        \[\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-def85.3%

        \[\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. +-commutative85.3%

        \[\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. +-commutative85.3%

        \[\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-unmult85.3%

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

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

      \[\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. associate-*r/74.4%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in74.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 82.0% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 57.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*57.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. +-commutative57.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. +-commutative57.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. +-commutative57.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*57.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. *-commutative57.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. associate-*r/77.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. *-commutative77.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-in3.0%

        \[\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-def77.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. +-commutative77.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. +-commutative77.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-unmult77.4%

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

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

      \[\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. associate-*r/57.9%

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

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

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in57.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
    7. Taylor expanded in y around 0 87.6%

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

    if -2.9000000000000001e166 < x < -3.60000000000000008e-96

    1. Initial program 76.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. times-frac93.0%

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

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

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified93.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 58.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]

    if -3.60000000000000008e-96 < x

    1. Initial program 74.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*74.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. +-commutative74.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. +-commutative74.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. +-commutative74.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. *-commutative74.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      6. associate-*l*74.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. times-frac90.2%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative90.2%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative90.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. associate-+l+90.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified90.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around inf 61.5%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/61.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + \left(x + 1\right)}}{y}} \]
      2. *-un-lft-identity61.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr61.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
    7. Taylor expanded in x around 0 61.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y} \]
    8. Step-by-step derivation
      1. +-commutative61.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{y} \]
    9. Simplified61.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.9 \cdot 10^{+166}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -3.6 \cdot 10^{-96}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]

Alternative 16: 81.1% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= y 1.8e-170) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y x)) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		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 <= 1.8d-170) 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 <= 1.8e-170) {
		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 <= 1.8e-170:
		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 <= 1.8e-170)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / Float64(y + 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 <= 1.8e-170)
		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, 1.8e-170], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.8000000000000002e-170

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified89.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 53.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*55.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.7%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified55.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 1.8000000000000002e-170 < y

    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-*l*71.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. +-commutative71.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. +-commutative71.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. +-commutative71.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*71.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. *-commutative71.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. associate-*r/83.5%

        \[\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. *-commutative83.5%

        \[\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-in75.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-def83.5%

        \[\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. +-commutative83.5%

        \[\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. +-commutative83.5%

        \[\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-unmult83.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative83.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified83.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. associate-*r/71.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. *-commutative71.0%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      3. fma-udef66.1%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      4. cube-mult66.2%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      5. distribute-rgt1-in71.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      6. *-commutative71.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      7. +-commutative71.0%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      8. associate-+r+71.0%

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
      9. frac-times86.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
      10. *-commutative86.9%

        \[\leadsto \color{blue}{\frac{y}{y + \left(x + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      11. clear-num86.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
      12. associate-/r*99.7%

        \[\leadsto \frac{1}{\frac{y + \left(x + 1\right)}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
      13. frac-times99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{x + y}}{\frac{y + \left(x + 1\right)}{y} \cdot \left(x + y\right)}} \]
      14. *-un-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{\frac{y + \left(x + 1\right)}{y} \cdot \left(x + y\right)} \]
      15. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{\frac{y + \left(x + 1\right)}{y} \cdot \left(x + y\right)} \]
      16. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{\frac{y + \left(x + 1\right)}{y} \cdot \color{blue}{\left(y + x\right)}} \]
    5. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{\frac{y + \left(x + 1\right)}{y} \cdot \left(y + x\right)}} \]
    6. Taylor expanded in x around 0 62.1%

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{1 + y}} \]
    7. Step-by-step derivation
      1. +-commutative62.1%

        \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + 1}} \]
    8. Simplified62.1%

      \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + 1}\\ \end{array} \]

Alternative 17: 81.2% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{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.8e-170) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + (x + 1.0))) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.8d-170) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = (x / (y + (x + 1.0d0))) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + (x + 1.0))) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 1.8e-170:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / (y + (x + 1.0))) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 1.8e-170)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.8e-170)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / (y + (x + 1.0))) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 1.8e-170], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.8000000000000002e-170

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified89.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 53.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*55.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.7%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified55.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 1.8000000000000002e-170 < y

    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-*l*71.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. +-commutative71.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. +-commutative71.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. +-commutative71.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. *-commutative71.0%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      6. associate-*l*71.0%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. times-frac86.9%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative86.9%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative86.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. associate-+l+86.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified86.9%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around inf 61.9%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/62.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + \left(x + 1\right)}}{y}} \]
      2. *-un-lft-identity62.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr62.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\ \end{array} \]

Alternative 18: 80.9% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 7.5 \cdot 10^{-176}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{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 7.5e-176) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y (+ x 1.0))) y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 7.5e-176) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = (x / (y + (x + 1.0))) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 7.5d-176) then
        tmp = (y / (y + x)) / (x + 1.0d0)
    else
        tmp = (x / (y + (x + 1.0d0))) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 7.5e-176) {
		tmp = (y / (y + x)) / (x + 1.0);
	} else {
		tmp = (x / (y + (x + 1.0))) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 7.5e-176:
		tmp = (y / (y + x)) / (x + 1.0)
	else:
		tmp = (x / (y + (x + 1.0))) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 7.5e-176)
		tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / Float64(y + Float64(x + 1.0))) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 7.5e-176)
		tmp = (y / (y + x)) / (x + 1.0);
	else
		tmp = (x / (y + (x + 1.0))) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 7.5e-176], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-176}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.5e-176

    1. Initial program 73.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*73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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*73.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. *-commutative73.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. associate-*r/86.0%

        \[\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. *-commutative86.0%

        \[\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-in61.8%

        \[\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-def86.0%

        \[\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. +-commutative86.0%

        \[\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. +-commutative86.0%

        \[\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-unmult86.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative86.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified86.0%

      \[\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. associate-*r/73.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef52.0%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult52.0%

        \[\leadsto \frac{y \cdot 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)}} \]
      4. distribute-rgt1-in73.7%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. *-commutative73.7%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      6. +-commutative73.7%

        \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      7. associate-+r+73.7%

        \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
      8. frac-times90.6%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
      9. *-commutative90.6%

        \[\leadsto \color{blue}{\frac{x}{y + \left(x + 1\right)} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      10. clear-num90.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{x}}} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \]
      11. associate-/r*99.7%

        \[\leadsto \frac{1}{\frac{y + \left(x + 1\right)}{x}} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
      12. frac-times99.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + y}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)}} \]
      13. *-un-lft-identity99.4%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + y}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
      14. +-commutative99.4%

        \[\leadsto \frac{\frac{y}{\color{blue}{y + x}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
      15. +-commutative99.4%

        \[\leadsto \frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \color{blue}{\left(y + x\right)}} \]
    5. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(y + x\right)}} \]
    6. Taylor expanded in y around 0 56.5%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{1 + x}} \]
    7. Step-by-step derivation
      1. +-commutative56.5%

        \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]
    8. Simplified56.5%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x + 1}} \]

    if 7.5e-176 < y

    1. Initial program 70.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*70.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. +-commutative70.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. +-commutative70.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. +-commutative70.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. *-commutative70.3%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      6. associate-*l*70.3%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. times-frac86.1%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative86.1%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative86.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. associate-+l+86.1%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified86.1%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around inf 62.3%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/62.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + \left(x + 1\right)}}{y}} \]
      2. *-un-lft-identity62.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr62.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7.5 \cdot 10^{-176}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + \left(x + 1\right)}}{y}\\ \end{array} \]

Alternative 19: 56.9% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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.7e-170)
   (- (/ y x) y)
   (if (<= y 0.76) (- (/ x y) x) (/ (/ x y) y))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.7e-170) {
		tmp = (y / x) - y;
	} else if (y <= 0.76) {
		tmp = (x / y) - x;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.7d-170) then
        tmp = (y / x) - y
    else if (y <= 0.76d0) then
        tmp = (x / y) - x
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.7e-170) {
		tmp = (y / x) - y;
	} else if (y <= 0.76) {
		tmp = (x / y) - x;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 1.7e-170:
		tmp = (y / x) - y
	elif y <= 0.76:
		tmp = (x / y) - x
	else:
		tmp = (x / y) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 1.7e-170)
		tmp = Float64(Float64(y / x) - y);
	elseif (y <= 0.76)
		tmp = Float64(Float64(x / y) - x);
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.7e-170)
		tmp = (y / x) - y;
	elseif (y <= 0.76)
		tmp = (x / y) - x;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 1.7e-170], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{-170}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.70000000000000006e-170

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified89.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 53.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*55.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.7%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified55.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    7. Taylor expanded in x around 0 18.4%

      \[\leadsto \color{blue}{-1 \cdot y + \frac{y}{x}} \]
    8. Step-by-step derivation
      1. neg-mul-118.4%

        \[\leadsto \color{blue}{\left(-y\right)} + \frac{y}{x} \]
      2. +-commutative18.4%

        \[\leadsto \color{blue}{\frac{y}{x} + \left(-y\right)} \]
      3. unsub-neg18.4%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    9. Simplified18.4%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if 1.70000000000000006e-170 < y < 0.76000000000000001

    1. Initial program 87.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac96.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative96.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+96.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified96.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 46.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative46.7%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified46.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 46.3%

      \[\leadsto \color{blue}{-1 \cdot x + \frac{x}{y}} \]
    8. Step-by-step derivation
      1. neg-mul-146.3%

        \[\leadsto \color{blue}{\left(-x\right)} + \frac{x}{y} \]
      2. +-commutative46.3%

        \[\leadsto \color{blue}{\frac{x}{y} + \left(-x\right)} \]
      3. unsub-neg46.3%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified46.3%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 0.76000000000000001 < 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. *-commutative59.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      6. associate-*l*59.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. times-frac79.8%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative79.8%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative79.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. associate-+l+79.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified79.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around inf 72.6%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/72.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + \left(x + 1\right)}}{y}} \]
      2. *-un-lft-identity72.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr72.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
    7. Taylor expanded in y around inf 72.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification35.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.7 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 20: 82.4% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-97}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.35e-97) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.35e-97) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.35d-97)) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = (x / (y + 1.0d0)) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.35e-97) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.35e-97:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / (y + 1.0)) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.35e-97)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / Float64(y + 1.0)) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.35e-97)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / (y + 1.0)) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.35e-97], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-97}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.34999999999999993e-97

    1. Initial program 67.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. times-frac85.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative85.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+85.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 67.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*71.0%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative71.0%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified71.0%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if -1.34999999999999993e-97 < x

    1. Initial program 74.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*74.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. +-commutative74.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. +-commutative74.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. +-commutative74.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. *-commutative74.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      6. associate-*l*74.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. times-frac90.2%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. +-commutative90.2%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1} \]
      9. +-commutative90.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{x}{\left(y + x\right) + 1} \]
      10. associate-+l+90.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified90.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around inf 61.5%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y + \left(x + 1\right)} \]
    5. Step-by-step derivation
      1. associate-*l/61.6%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + \left(x + 1\right)}}{y}} \]
      2. *-un-lft-identity61.6%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + \left(x + 1\right)}}}{y} \]
    6. Applied egg-rr61.6%

      \[\leadsto \color{blue}{\frac{\frac{x}{y + \left(x + 1\right)}}{y}} \]
    7. Taylor expanded in x around 0 61.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y} \]
    8. Step-by-step derivation
      1. +-commutative61.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{y} \]
    9. Simplified61.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{-97}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]

Alternative 21: 34.5% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x} - y\\ \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.8e-170) (- (/ y x) y) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 1.8e-170) {
		tmp = (y / x) - y;
	} 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.8d-170) then
        tmp = (y / x) - y
    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.8e-170) {
		tmp = (y / x) - y;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 1.8e-170:
		tmp = (y / x) - y
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 1.8e-170)
		tmp = Float64(Float64(y / x) - y);
	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.8e-170)
		tmp = (y / x) - y;
	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.8e-170], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.8000000000000002e-170

    1. Initial program 73.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified89.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in y around 0 53.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*55.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.7%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified55.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    7. Taylor expanded in x around 0 18.4%

      \[\leadsto \color{blue}{-1 \cdot y + \frac{y}{x}} \]
    8. Step-by-step derivation
      1. neg-mul-118.4%

        \[\leadsto \color{blue}{\left(-y\right)} + \frac{y}{x} \]
      2. +-commutative18.4%

        \[\leadsto \color{blue}{\frac{y}{x} + \left(-y\right)} \]
      3. unsub-neg18.4%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    9. Simplified18.4%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if 1.8000000000000002e-170 < y

    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. times-frac86.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative86.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      3. associate-+l+86.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
    3. Simplified86.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
    4. Taylor expanded in x around 0 55.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative55.8%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified55.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 32.9%

      \[\leadsto \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification24.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-170}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 22: 4.1% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{0.5}{y} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ 0.5 y))
assert(x < y);
double code(double x, double y) {
	return 0.5 / 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 = 0.5d0 / y
end function
assert x < y;
public static double code(double x, double y) {
	return 0.5 / y;
}
[x, y] = sort([x, y])
def code(x, y):
	return 0.5 / y
x, y = sort([x, y])
function code(x, y)
	return Float64(0.5 / y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = 0.5 / y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(0.5 / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{0.5}{y}
\end{array}
Derivation
  1. Initial program 72.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*72.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. +-commutative72.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. +-commutative72.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. +-commutative72.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*72.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. *-commutative72.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. associate-*r/84.7%

      \[\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. *-commutative84.7%

      \[\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-in67.1%

      \[\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-def84.7%

      \[\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. +-commutative84.7%

      \[\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. +-commutative84.7%

      \[\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-unmult84.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    14. +-commutative84.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified84.7%

    \[\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. associate-*r/72.3%

      \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    2. fma-udef57.5%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult57.5%

      \[\leadsto \frac{y \cdot 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)}} \]
    4. distribute-rgt1-in72.3%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    5. *-commutative72.3%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    6. +-commutative72.3%

      \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
    7. associate-+r+72.3%

      \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
    8. frac-times88.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    9. *-commutative88.8%

      \[\leadsto \color{blue}{\frac{x}{y + \left(x + 1\right)} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    10. clear-num88.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{x}}} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \]
    11. associate-/r*99.7%

      \[\leadsto \frac{1}{\frac{y + \left(x + 1\right)}{x}} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
    12. frac-times99.5%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + y}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)}} \]
    13. *-un-lft-identity99.5%

      \[\leadsto \frac{\color{blue}{\frac{y}{x + y}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
    14. +-commutative99.5%

      \[\leadsto \frac{\frac{y}{\color{blue}{y + x}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
    15. +-commutative99.5%

      \[\leadsto \frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \color{blue}{\left(y + x\right)}} \]
  5. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(y + x\right)}} \]
  6. Taylor expanded in x around -inf 50.4%

    \[\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. mul-1-neg50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x + \color{blue}{\left(-\left(-1 \cdot y + -1 \cdot \left(1 + y\right)\right)\right)}} \]
    2. unsub-neg50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x - \left(-1 \cdot y + -1 \cdot \left(1 + y\right)\right)}} \]
    3. neg-mul-150.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \left(\color{blue}{\left(-y\right)} + -1 \cdot \left(1 + y\right)\right)} \]
    4. +-commutative50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \color{blue}{\left(-1 \cdot \left(1 + y\right) + \left(-y\right)\right)}} \]
    5. unsub-neg50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \color{blue}{\left(-1 \cdot \left(1 + y\right) - y\right)}} \]
    6. distribute-lft-in50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \left(\color{blue}{\left(-1 \cdot 1 + -1 \cdot y\right)} - y\right)} \]
    7. metadata-eval50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \left(\left(\color{blue}{-1} + -1 \cdot y\right) - y\right)} \]
    8. neg-mul-150.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \left(\left(-1 + \color{blue}{\left(-y\right)}\right) - y\right)} \]
    9. unsub-neg50.4%

      \[\leadsto \frac{\frac{y}{y + x}}{x - \left(\color{blue}{\left(-1 - y\right)} - y\right)} \]
  8. Simplified50.4%

    \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x - \left(\left(-1 - y\right) - y\right)}} \]
  9. Taylor expanded in y around inf 4.0%

    \[\leadsto \color{blue}{\frac{0.5}{y}} \]
  10. Final simplification4.0%

    \[\leadsto \frac{0.5}{y} \]

Alternative 23: 4.3% 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 72.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*72.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. +-commutative72.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. +-commutative72.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. +-commutative72.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*72.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. *-commutative72.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. associate-*r/84.7%

      \[\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. *-commutative84.7%

      \[\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-in67.1%

      \[\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-def84.7%

      \[\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. +-commutative84.7%

      \[\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. +-commutative84.7%

      \[\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-unmult84.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    14. +-commutative84.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified84.7%

    \[\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. associate-*r/72.3%

      \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    2. fma-udef57.5%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult57.5%

      \[\leadsto \frac{y \cdot 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)}} \]
    4. distribute-rgt1-in72.3%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    5. *-commutative72.3%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    6. +-commutative72.3%

      \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
    7. associate-+r+72.3%

      \[\leadsto \frac{y \cdot x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
    8. frac-times88.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{y + \left(x + 1\right)}} \]
    9. *-commutative88.8%

      \[\leadsto \color{blue}{\frac{x}{y + \left(x + 1\right)} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    10. clear-num88.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{x}}} \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \]
    11. associate-/r*99.7%

      \[\leadsto \frac{1}{\frac{y + \left(x + 1\right)}{x}} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
    12. frac-times99.5%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{y}{x + y}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)}} \]
    13. *-un-lft-identity99.5%

      \[\leadsto \frac{\color{blue}{\frac{y}{x + y}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
    14. +-commutative99.5%

      \[\leadsto \frac{\frac{y}{\color{blue}{y + x}}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(x + y\right)} \]
    15. +-commutative99.5%

      \[\leadsto \frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \color{blue}{\left(y + x\right)}} \]
  5. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x} \cdot \left(y + x\right)}} \]
  6. Taylor expanded in x around inf 38.3%

    \[\leadsto \frac{\frac{y}{y + x}}{\color{blue}{x}} \]
  7. Taylor expanded in y around inf 4.3%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  8. Final simplification4.3%

    \[\leadsto \frac{1}{x} \]

Alternative 24: 26.4% 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 72.3%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. times-frac88.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. +-commutative88.7%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    3. associate-+l+88.7%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + \left(x + 1\right)}} \]
  3. Simplified88.7%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{y + \left(x + 1\right)}} \]
  4. Taylor expanded in x around 0 48.2%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  5. Step-by-step derivation
    1. +-commutative48.2%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
  6. Simplified48.2%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  7. Taylor expanded in y around 0 29.6%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  8. Final simplification29.6%

    \[\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 2023336 
(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))))