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

Percentage Accurate: 69.4% → 99.7%
Time: 14.0s
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.4% 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.7% accurate, 1.0× speedup?

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

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/l*82.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+82.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. Simplified82.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. Step-by-step derivation
    1. clear-num82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e154 < x < -5.19999999999999993e-14

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999993e-14 < x < 2.8999999999999999e-71

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8999999999999999e-71 < x

    1. Initial program 64.1%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr33.5%

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

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

Alternative 3: 95.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.2000000000000001e154 < x < -4.1999999999999998e-14

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

    if -4.1999999999999998e-14 < x < 3.1999999999999998e-111

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999998e-111 < x

    1. Initial program 65.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.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+79.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. Simplified79.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 x around 0 31.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr35.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+154}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-14}:\\ \;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.9% 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.6 \cdot 10^{+58}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\ \mathbf{elif}\;x \leq -1.95 \cdot 10^{-59}:\\ \;\;\;\;x \cdot \frac{y}{t\_0 \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{x}{x + y}}{x + y}}{\frac{y + 1}{y}}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ x (+ y 1.0))))
   (if (<= x -1.6e+58)
     (/ (/ y (+ x y)) t_0)
     (if (<= x -1.95e-59)
       (* x (/ y (* t_0 (* (+ x y) (+ x y)))))
       (/ (/ (/ x (+ x y)) (+ x y)) (/ (+ y 1.0) y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = x + (y + 1.0);
	double tmp;
	if (x <= -1.6e+58) {
		tmp = (y / (x + y)) / t_0;
	} else if (x <= -1.95e-59) {
		tmp = x * (y / (t_0 * ((x + y) * (x + y))));
	} else {
		tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x + (y + 1.0d0)
    if (x <= (-1.6d+58)) then
        tmp = (y / (x + y)) / t_0
    else if (x <= (-1.95d-59)) then
        tmp = x * (y / (t_0 * ((x + y) * (x + y))))
    else
        tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0d0) / y)
    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.6e+58) {
		tmp = (y / (x + y)) / t_0;
	} else if (x <= -1.95e-59) {
		tmp = x * (y / (t_0 * ((x + y) * (x + y))));
	} else {
		tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = x + (y + 1.0)
	tmp = 0
	if x <= -1.6e+58:
		tmp = (y / (x + y)) / t_0
	elif x <= -1.95e-59:
		tmp = x * (y / (t_0 * ((x + y) * (x + y))))
	else:
		tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y)
	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.6e+58)
		tmp = Float64(Float64(y / Float64(x + y)) / t_0);
	elseif (x <= -1.95e-59)
		tmp = Float64(x * Float64(y / Float64(t_0 * Float64(Float64(x + y) * Float64(x + y)))));
	else
		tmp = Float64(Float64(Float64(x / Float64(x + y)) / Float64(x + y)) / Float64(Float64(y + 1.0) / y));
	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.6e+58)
		tmp = (y / (x + y)) / t_0;
	elseif (x <= -1.95e-59)
		tmp = x * (y / (t_0 * ((x + y) * (x + y))));
	else
		tmp = ((x / (x + y)) / (x + y)) / ((y + 1.0) / y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+58], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[x, -1.95e-59], N[(x * N[(y / N[(t$95$0 * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $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.6 \cdot 10^{+58}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{t\_0}\\

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

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


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

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.60000000000000008e58 < x < -1.95000000000000009e-59

    1. Initial program 94.6%

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

    if -1.95000000000000009e-59 < x

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.5% accurate, 0.7× speedup?

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

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

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

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


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

    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.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+80.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. Simplified80.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. Step-by-step derivation
      1. clear-num80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr52.7%

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

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

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

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

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

    if 3.3500000000000001e-163 < y < 6.6000000000000005e-5

    1. Initial program 87.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*93.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+93.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. Simplified93.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 92.0%

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

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

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

    if 6.6000000000000005e-5 < y < 5.7000000000000002e109

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.7000000000000002e109 < y

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 94.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999994e154 < x < -1.6e-30

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

    if -1.6e-30 < x

    1. Initial program 67.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*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. Step-by-step derivation
      1. clear-num82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 95.5% accurate, 0.8× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000002e125 < y

    1. Initial program 61.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*79.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+79.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. Simplified79.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. Step-by-step derivation
      1. clear-num79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 95.5% accurate, 0.8× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*69.2%

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

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

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

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

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

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

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

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

    if 3.80000000000000002e125 < y

    1. Initial program 61.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*79.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+79.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. Simplified79.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. Step-by-step derivation
      1. clear-num79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 86.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 65.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. 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. Step-by-step derivation
      1. clear-num80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr53.0%

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

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

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

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

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

    if 3.5000000000000003e-160 < y < 2.8500000000000001e109

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8500000000000001e109 < y

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{+139}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -2.8 \cdot 10^{-153}:\\ \;\;\;\;\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.7e+139)
   (/ (/ y x) x)
   (if (<= x -2.8e-153) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.7e+139) {
		tmp = (y / x) / x;
	} else if (x <= -2.8e-153) {
		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.7d+139)) then
        tmp = (y / x) / x
    else if (x <= (-2.8d-153)) 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.7e+139) {
		tmp = (y / x) / x;
	} else if (x <= -2.8e-153) {
		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.7e+139:
		tmp = (y / x) / x
	elif x <= -2.8e-153:
		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.7e+139)
		tmp = Float64(Float64(y / x) / x);
	elseif (x <= -2.8e-153)
		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.7e+139)
		tmp = (y / x) / x;
	elseif (x <= -2.8e-153)
		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.7e+139], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -2.8e-153], 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.7 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\

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

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


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

    1. Initial program 71.4%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    8. Taylor expanded in x around inf 90.8%

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

    if -4.7000000000000001e139 < x < -2.8000000000000001e-153

    1. Initial program 78.1%

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

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

Alternative 11: 78.9% accurate, 1.0× speedup?

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

\mathbf{elif}\;x \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 70.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*80.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+80.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. Simplified80.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 y around 0 77.9%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    8. Taylor expanded in x around inf 79.2%

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

    if -1 < x < -2.8000000000000001e-153

    1. Initial program 86.1%

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

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

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

Alternative 12: 81.3% accurate, 1.1× speedup?

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

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Step-by-step derivation
      1. clear-num86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr66.9%

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

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 81.3% accurate, 1.2× speedup?

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

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Step-by-step derivation
      1. clear-num86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr66.9%

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

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 80.0% accurate, 1.2× speedup?

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

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Step-by-step derivation
      1. clear-num86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr66.9%

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

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 60.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{y}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 67.3% accurate, 1.3× speedup?

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

\mathbf{elif}\;x \leq -2.7 \cdot 10^{-153}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 70.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*80.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+80.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. Simplified80.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 y around 0 77.9%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    8. Taylor expanded in x around inf 79.2%

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

    if -1 < x < -2.70000000000000009e-153

    1. Initial program 86.1%

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

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

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

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

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

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

    if -2.70000000000000009e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 65.5% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 70.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*80.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+80.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. Simplified80.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. Step-by-step derivation
      1. clear-num80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.05000000000000002e-153

    1. Initial program 86.1%

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

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

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

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

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

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

    if -1.05000000000000002e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 17: 80.0% accurate, 1.4× speedup?

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

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Step-by-step derivation
      1. clear-num86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{x} \cdot \frac{y}{x + 1}} \]
    17. Applied egg-rr66.9%

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

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

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

Alternative 18: 80.0% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.8 \cdot 10^{-153}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \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 -2.8e-153) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -2.8e-153) {
		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 <= (-2.8d-153)) 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 <= -2.8e-153) {
		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 <= -2.8e-153:
		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 <= -2.8e-153)
		tmp = Float64(Float64(y / 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 <= -2.8e-153)
		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, -2.8e-153], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $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 -2.8 \cdot 10^{-153}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Taylor expanded in y around 0 66.1%

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

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

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

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

    if -2.8000000000000001e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

Alternative 19: 44.5% accurate, 2.1× speedup?

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

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


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

    1. Initial program 75.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*86.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+86.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. Simplified86.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
    5. Taylor expanded in y around 0 66.1%

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

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

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

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

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

    if -2.4000000000000002e-153 < x

    1. Initial program 64.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*79.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+79.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. Simplified79.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 61.0%

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

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

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

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 28.1% accurate, 2.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{-35}:\\ \;\;\;\;\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 -2.45e-35) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -2.45e-35) {
		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 <= (-2.45d-35)) 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 <= -2.45e-35) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -2.45e-35:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -2.45e-35)
		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 <= -2.45e-35)
		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, -2.45e-35], 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 -2.45 \cdot 10^{-35}:\\
\;\;\;\;\frac{1}{x}\\

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


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

    1. Initial program 71.8%

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

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

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

    if -2.4500000000000002e-35 < x

    1. Initial program 67.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*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 x around 0 61.5%

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

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

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

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 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 68.3%

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

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

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  7. 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 2024135 
(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))))