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

Percentage Accurate: 69.2% → 99.3%
Time: 13.8s
Alternatives: 21
Speedup: 1.4×

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

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

Initial Program: 69.2% 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, 0.7× speedup?

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    6. fma-define64.3%

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    7. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    8. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    9. cube-unmult64.3%

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

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

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

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult48.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.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. *-commutative64.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. associate-*l*64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{y}{y + x} \cdot \frac{1}{\left(x + 1\right) + y \cdot \left(\left(2 + \frac{1}{x}\right) + \frac{y}{x}\right)} \]
  15. Add Preprocessing

Alternative 2: 92.2% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-160}:\\
\;\;\;\;y \cdot \frac{t\_0}{\left(y + x\right) \cdot \left(y + 1\right)}\\

\mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \frac{y}{t\_1 \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\


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

    1. Initial program 59.6%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.7%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult39.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-in59.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. *-commutative59.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. associate-*l*59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.20000000000000027e-278 < y < 4.2000000000000001e-160

    1. Initial program 58.7%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define58.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative58.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative58.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult58.8%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative58.8%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult42.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-in58.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. *-commutative58.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. associate-*l*58.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e-160 < y < 8.99999999999999969e73

    1. Initial program 89.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*94.9%

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

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

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

    if 8.99999999999999969e73 < y

    1. Initial program 50.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. +-commutative50.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define50.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult50.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative50.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in50.0%

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

        \[\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. associate-*l*50.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{-278}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{\left(x + 1\right) + y \cdot 2}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-160}:\\ \;\;\;\;y \cdot \frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\ \;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 93.6% accurate, 0.6× speedup?

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

\mathbf{elif}\;x \leq -5.8 \cdot 10^{-12}:\\
\;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot t\_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_0}\\


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

    1. Initial program 46.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. +-commutative46.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define46.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define0.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-in46.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. *-commutative46.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. associate-*l*46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e163 < x < -5.8000000000000003e-12

    1. Initial program 77.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. +-commutative77.6%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define77.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative77.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative77.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult77.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative77.6%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult69.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-in77.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. *-commutative77.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. associate-*l*77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000003e-12 < x < 1.00000000000000001e-150

    1. Initial program 59.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. +-commutative59.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.1%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult46.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-in59.0%

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

        \[\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. associate-*l*59.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e-150 < x

    1. Initial program 70.6%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define70.6%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult70.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative70.6%

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

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

        \[\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-in70.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. *-commutative70.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. associate-*l*70.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{+163}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{\left(x + 1\right) + y \cdot 2}\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-12}:\\ \;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{elif}\;x \leq 10^{-150}:\\ \;\;\;\;y \cdot \frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.5% accurate, 0.6× speedup?

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

\mathbf{elif}\;x \leq -7.1 \cdot 10^{-12}:\\
\;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot t\_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_0}\\


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

    1. Initial program 46.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. +-commutative46.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define46.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define0.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-in46.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. *-commutative46.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. associate-*l*46.5%

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

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

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

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

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

    if -1.06e163 < x < -7.1e-12

    1. Initial program 77.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. +-commutative77.6%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define77.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative77.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative77.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult77.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative77.6%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult69.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-in77.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. *-commutative77.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. associate-*l*77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1e-12 < x < 1.00000000000000001e-150

    1. Initial program 59.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. +-commutative59.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.1%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult46.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-in59.0%

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

        \[\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. associate-*l*59.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000001e-150 < x

    1. Initial program 70.6%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define70.6%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult70.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative70.6%

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

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

        \[\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-in70.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. *-commutative70.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. associate-*l*70.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{+163}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -7.1 \cdot 10^{-12}:\\ \;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{elif}\;x \leq 10^{-150}:\\ \;\;\;\;y \cdot \frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 91.1% accurate, 0.6× speedup?

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

\mathbf{elif}\;x \leq -9.5 \cdot 10^{-22}:\\
\;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot t\_0}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\


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

    1. Initial program 46.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. +-commutative46.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define46.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define0.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-in46.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. *-commutative46.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. associate-*l*46.5%

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

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

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

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

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

    if -1.06e163 < x < -9.4999999999999994e-22

    1. Initial program 79.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. +-commutative79.2%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define79.3%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative79.3%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative79.3%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult79.2%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative79.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult69.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-in79.2%

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

        \[\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. associate-*l*79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.4999999999999994e-22 < x < -1.05e-160

    1. Initial program 90.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*99.6%

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

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

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

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

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

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

    if -1.05e-160 < x

    1. Initial program 60.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. +-commutative60.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define60.9%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative60.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative60.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult61.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative61.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult51.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-in60.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. *-commutative60.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. associate-*l*60.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{+163}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -9.5 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \frac{1}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{elif}\;x \leq -1.05 \cdot 10^{-160}:\\ \;\;\;\;x \cdot \frac{y}{\left(y + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 96.8% accurate, 0.6× speedup?

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

\mathbf{elif}\;x \leq 10^{-150}:\\
\;\;\;\;t\_1 \cdot \frac{x}{\left(y + x\right) \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\


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

    1. Initial program 46.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. +-commutative46.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define46.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define0.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-in46.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. *-commutative46.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. associate-*l*46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000008e163 < x < 1.00000000000000001e-150

    1. Initial program 64.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. +-commutative64.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define64.9%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative64.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative64.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult64.9%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative64.9%

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

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

        \[\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.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. *-commutative64.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. associate-*l*64.9%

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

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

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

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

    if 1.00000000000000001e-150 < x

    1. Initial program 70.6%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define70.6%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative70.6%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult70.6%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative70.6%

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

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

        \[\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-in70.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. *-commutative70.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. associate-*l*70.5%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 94.5% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq 1.02 \cdot 10^{+63}:\\
\;\;\;\;y \cdot \frac{t\_0}{\left(y + x\right) \cdot t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{t\_1}\\


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

    1. Initial program 59.6%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.7%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult39.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-in59.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. *-commutative59.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. associate-*l*59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999969e-279 < y < 1.02e63

    1. Initial program 75.5%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define75.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult60.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-in75.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. *-commutative75.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. associate-*l*75.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02e63 < y

    1. Initial program 51.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. +-commutative51.2%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define51.2%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative51.2%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative51.2%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult51.2%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative51.2%

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

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

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

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

        \[\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. associate-*l*51.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5 \cdot 10^{-279}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{\left(x + 1\right) + y \cdot 2}\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+63}:\\ \;\;\;\;y \cdot \frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.5% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\


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

    1. Initial program 59.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. +-commutative59.7%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.7%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.7%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.7%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult40.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-in59.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. *-commutative59.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. associate-*l*59.7%

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

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

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

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

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

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

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

    if 1.8499999999999999e-159 < y < 2.10000000000000015e-27

    1. Initial program 84.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*96.3%

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

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

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

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

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

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

    if 2.10000000000000015e-27 < y < 8.99999999999999969e73

    1. Initial program 95.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. +-commutative95.3%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define95.3%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative95.3%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative95.3%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult95.4%

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

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

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

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

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

        \[\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-in95.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. *-commutative95.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. associate-*l*95.3%

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

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

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

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

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

    if 8.99999999999999969e73 < y

    1. Initial program 50.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. +-commutative50.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define50.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult50.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative50.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in50.0%

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

        \[\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. associate-*l*50.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.85 \cdot 10^{-159}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-27}:\\ \;\;\;\;x \cdot \frac{y}{\left(x + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.2% accurate, 0.8× speedup?

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

\mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{t\_0}\\


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

    1. Initial program 59.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. +-commutative59.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define59.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative59.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult59.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative59.0%

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

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

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

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

        \[\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. associate-*l*59.0%

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

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

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

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

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

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

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

    if 2.89999999999999995e-185 < y < 8.99999999999999969e73

    1. Initial program 85.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. +-commutative85.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define85.9%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative85.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative85.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult85.9%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative85.9%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult70.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-in85.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. *-commutative85.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. associate-*l*85.9%

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

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

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

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

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

    if 8.99999999999999969e73 < y

    1. Initial program 50.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. +-commutative50.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define50.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative50.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult50.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative50.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in50.0%

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

        \[\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. associate-*l*50.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.9 \cdot 10^{-185}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+73}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 99.2% accurate, 0.9× speedup?

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    6. fma-define64.3%

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    7. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    8. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    9. cube-unmult64.3%

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

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

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

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult48.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.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. *-commutative64.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. associate-*l*64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 81.6% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{+163}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-65}:\\ \;\;\;\;\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.06e+163)
   (* (/ y (+ y x)) (/ 1.0 x))
   (if (<= x -1.3e-65) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.06e+163) {
		tmp = (y / (y + x)) * (1.0 / x);
	} else if (x <= -1.3e-65) {
		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.06d+163)) then
        tmp = (y / (y + x)) * (1.0d0 / x)
    else if (x <= (-1.3d-65)) 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.06e+163) {
		tmp = (y / (y + x)) * (1.0 / x);
	} else if (x <= -1.3e-65) {
		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.06e+163:
		tmp = (y / (y + x)) * (1.0 / x)
	elif x <= -1.3e-65:
		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.06e+163)
		tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / x));
	elseif (x <= -1.3e-65)
		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.06e+163)
		tmp = (y / (y + x)) * (1.0 / x);
	elseif (x <= -1.3e-65)
		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.06e+163], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.3e-65], 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.06 \cdot 10^{+163}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\

\mathbf{elif}\;x \leq -1.3 \cdot 10^{-65}:\\
\;\;\;\;\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.06e163

    1. Initial program 46.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. +-commutative46.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define46.5%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define0.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-in46.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. *-commutative46.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. associate-*l*46.5%

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

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

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

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

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

    if -1.06e163 < x < -1.30000000000000005e-65

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

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

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

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

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

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

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

    if -1.30000000000000005e-65 < x

    1. Initial program 63.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*78.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.06 \cdot 10^{+163}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -1.3 \cdot 10^{-65}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 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{x + \left(y + 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) (/ (+ x (+ y 1.0)) x))))
assert(x < y);
double code(double x, double y) {
	return (y / (y + x)) / ((y + x) * ((x + (y + 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) * ((x + (y + 1.0d0)) / x))
end function
assert x < y;
public static double code(double x, double y) {
	return (y / (y + x)) / ((y + x) * ((x + (y + 1.0)) / x));
}
[x, y] = sort([x, y])
def code(x, y):
	return (y / (y + x)) / ((y + x) * ((x + (y + 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(x + Float64(y + 1.0)) / x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = (y / (y + x)) / ((y + x) * ((x + (y + 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[(x + N[(y + 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{x + \left(y + 1\right)}{x}}
\end{array}
Derivation
  1. Initial program 64.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. +-commutative64.3%

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    6. fma-define64.3%

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    7. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    8. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    9. cube-unmult64.3%

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

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

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

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult48.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.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. *-commutative64.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. associate-*l*64.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 81.8% accurate, 1.1× speedup?

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

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


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

    1. Initial program 65.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. +-commutative65.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define65.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative65.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative65.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult65.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative65.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult37.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-in65.0%

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

        \[\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. associate-*l*65.0%

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

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

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

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

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

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

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

    if -6.5000000000000004e-64 < x

    1. Initial program 63.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. +-commutative63.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define63.9%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative63.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative63.9%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult63.9%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative63.9%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult54.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-in63.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. *-commutative63.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. associate-*l*63.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-64}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 82.0% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-68}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -4.2e-68)
   (* (/ y (+ y x)) (/ 1.0 (+ x 1.0)))
   (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.2e-68) {
		tmp = (y / (y + x)) * (1.0 / (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 <= (-4.2d-68)) then
        tmp = (y / (y + x)) * (1.0d0 / (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 <= -4.2e-68) {
		tmp = (y / (y + x)) * (1.0 / (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 <= -4.2e-68:
		tmp = (y / (y + x)) * (1.0 / (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 <= -4.2e-68)
		tmp = Float64(Float64(y / Float64(y + x)) * Float64(1.0 / 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 <= -4.2e-68)
		tmp = (y / (y + x)) * (1.0 / (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, -4.2e-68], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / 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 -4.2 \cdot 10^{-68}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\

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


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

    1. Initial program 65.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. +-commutative65.0%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define65.0%

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      7. +-commutative65.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      8. +-commutative65.0%

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult65.0%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative65.0%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult37.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-in65.0%

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

        \[\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. associate-*l*65.0%

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

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

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

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

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

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

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

    if -4.20000000000000016e-68 < x

    1. Initial program 63.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*78.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-68}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 48.6% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-39} \lor \neg \left(y \leq 0.76\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{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 (or (<= y -8e-39) (not (<= y 0.76))) (/ x (* y y)) (- (/ x y) x)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if ((y <= -8e-39) || !(y <= 0.76)) {
		tmp = x / (y * y);
	} else {
		tmp = (x / 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 <= (-8d-39)) .or. (.not. (y <= 0.76d0))) then
        tmp = x / (y * y)
    else
        tmp = (x / y) - x
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if ((y <= -8e-39) || !(y <= 0.76)) {
		tmp = x / (y * y);
	} else {
		tmp = (x / y) - x;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if (y <= -8e-39) or not (y <= 0.76):
		tmp = x / (y * y)
	else:
		tmp = (x / y) - x
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if ((y <= -8e-39) || !(y <= 0.76))
		tmp = Float64(x / Float64(y * y));
	else
		tmp = Float64(Float64(x / y) - x);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -8e-39) || ~((y <= 0.76)))
		tmp = x / (y * y);
	else
		tmp = (x / 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[Or[LessEqual[y, -8e-39], N[Not[LessEqual[y, 0.76]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{-39} \lor \neg \left(y \leq 0.76\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.99999999999999943e-39 or 0.76000000000000001 < y

    1. Initial program 59.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*76.5%

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

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

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

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

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

    if -7.99999999999999943e-39 < y < 0.76000000000000001

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    13. Simplified29.8%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification47.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{-39} \lor \neg \left(y \leq 0.76\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - x\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 79.7% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{-63}:\\ \;\;\;\;\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 -4.8e-63) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.8e-63) {
		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 <= (-4.8d-63)) 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 <= -4.8e-63) {
		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 <= -4.8e-63:
		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 <= -4.8e-63)
		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 <= -4.8e-63)
		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, -4.8e-63], 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 -4.8 \cdot 10^{-63}:\\
\;\;\;\;\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 2 regimes
  2. if x < -4.8000000000000001e-63

    1. Initial program 65.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*80.2%

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

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

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

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

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

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

    if -4.8000000000000001e-63 < x

    1. Initial program 63.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*78.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 78.2% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -4.3e-63) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.3e-63) {
		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 <= (-4.3d-63)) 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 <= -4.3e-63) {
		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 <= -4.3e-63:
		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 <= -4.3e-63)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4.3e-63)
		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, -4.3e-63], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

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


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

    1. Initial program 65.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*80.2%

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

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

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

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

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

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

    if -4.2999999999999999e-63 < x

    1. Initial program 63.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*78.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 27.9% accurate, 2.1× speedup?

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

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


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

    1. Initial program 57.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. +-commutative57.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      6. fma-define57.5%

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

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

        \[\leadsto \frac{x \cdot y}{\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)} \]
      9. cube-unmult57.4%

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

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

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

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

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

        \[\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.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. *-commutative57.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. associate-*l*57.5%

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

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

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

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

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

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

    if -6.4999999999999996e23 < x

    1. Initial program 66.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*80.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 49.2% accurate, 2.4× speedup?

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

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

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

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

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

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

Alternative 20: 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 64.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. +-commutative64.3%

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    6. fma-define64.3%

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    7. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    8. +-commutative64.3%

      \[\leadsto \frac{x \cdot y}{\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)} \]
    9. cube-unmult64.3%

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

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

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

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult48.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.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. *-commutative64.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. associate-*l*64.3%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  9. Add Preprocessing

Alternative 21: 3.5% accurate, 17.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ 0.5 \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 0.5)
assert(x < y);
double code(double x, double y) {
	return 0.5;
}
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
end function
assert x < y;
public static double code(double x, double y) {
	return 0.5;
}
[x, y] = sort([x, y])
def code(x, y):
	return 0.5
x, y = sort([x, y])
function code(x, y)
	return 0.5
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = 0.5;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := 0.5
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
0.5
\end{array}
Derivation
  1. Initial program 64.3%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around 0 52.8%

    \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{y} + 1\right)} \]
  4. Taylor expanded in x around 0 33.0%

    \[\leadsto \frac{x \cdot y}{\color{blue}{\left(2 \cdot \left(x \cdot y\right) + {y}^{2}\right)} \cdot \left(y + 1\right)} \]
  5. Step-by-step derivation
    1. associate-*r*33.0%

      \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(2 \cdot x\right) \cdot y} + {y}^{2}\right) \cdot \left(y + 1\right)} \]
    2. +-commutative33.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left({y}^{2} + \left(2 \cdot x\right) \cdot y\right)} \cdot \left(y + 1\right)} \]
    3. unpow233.0%

      \[\leadsto \frac{x \cdot y}{\left(\color{blue}{y \cdot y} + \left(2 \cdot x\right) \cdot y\right) \cdot \left(y + 1\right)} \]
    4. distribute-rgt-in33.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y \cdot \left(y + 2 \cdot x\right)\right)} \cdot \left(y + 1\right)} \]
  6. Simplified33.0%

    \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y \cdot \left(y + 2 \cdot x\right)\right)} \cdot \left(y + 1\right)} \]
  7. Taylor expanded in y around 0 3.4%

    \[\leadsto \color{blue}{0.5} \]
  8. Add Preprocessing

Developer Target 1: 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 2024139 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))