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

Percentage Accurate: 68.6% → 99.4%
Time: 13.3s
Alternatives: 17
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 17 alternatives:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.29999999999999998e-92 < y < 1.49999999999999997e147

    1. Initial program 78.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. *-commutative78.4%

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

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

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

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

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

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

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

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

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

    if 1.49999999999999997e147 < y

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 92.7% accurate, 0.6× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.19999999999999996e32 < x < -4.99999999999999981e-165

    1. Initial program 77.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*93.3%

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

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

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

    if -4.99999999999999981e-165 < x

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.7% accurate, 0.7× speedup?

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

\mathbf{elif}\;x \leq -9.2 \cdot 10^{-44}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x}\\

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-6 < x < -9.19999999999999992e-44 or 8.49999999999999937e-129 < x

    1. Initial program 76.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999992e-44 < x < -2.49999999999999999e-91

    1. Initial program 72.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*92.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+92.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. Simplified92.7%

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

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

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

    if -2.49999999999999999e-91 < x < 8.49999999999999937e-129

    1. Initial program 64.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*72.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+72.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. Simplified72.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 78.1%

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

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

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

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

Alternative 5: 85.1% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 61.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. *-commutative61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000033e192 < x < -1.51999999999999991e-90

    1. Initial program 73.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative73.6%

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

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

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

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

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

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

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

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

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

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

    if -1.51999999999999991e-90 < x

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 95.1% accurate, 0.8× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000006e32 < x

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.9% accurate, 0.8× speedup?

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

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


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

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.51999999999999991e-90 < x

    1. Initial program 71.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. *-commutative71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 85.6% accurate, 0.8× speedup?

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

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


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

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

    if 3.40000000000000014e-50 < y

    1. Initial program 73.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. *-commutative73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.4% accurate, 1.1× speedup?

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

\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 67.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. Taylor expanded in y around 0 62.4%

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

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

    if 3.1000000000000001e-229 < y < 1

    1. Initial program 84.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*85.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+85.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. Simplified85.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 22.5%

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

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

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

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

    if 1 < y

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 81.9% accurate, 1.2× speedup?

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

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


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

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

    if 6.49999999999999968e-49 < y

    1. Initial program 73.5%

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

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

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

      \[\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. *-un-lft-identity85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 81.7% accurate, 1.4× speedup?

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

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


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

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

    if 1.08000000000000005e-47 < y

    1. Initial program 73.5%

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

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

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

      \[\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 62.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
    11. Applied egg-rr64.8%

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

Alternative 12: 79.5% accurate, 1.4× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-6 < x

    1. Initial program 72.4%

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

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

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

      \[\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 47.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
    11. Applied egg-rr48.8%

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

Alternative 13: 78.0% accurate, 1.4× speedup?

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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.6%

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-6 < x

    1. Initial program 72.4%

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

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

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

      \[\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 47.6%

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

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

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

Alternative 14: 43.5% accurate, 2.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-93}:\\ \;\;\;\;\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 -4e-93) (/ y x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4e-93) {
		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 <= (-4d-93)) 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 <= -4e-93) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -4e-93:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -4e-93)
		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 <= -4e-93)
		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, -4e-93], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-93}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 69.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*84.8%

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

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

      \[\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 70.0%

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

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

    if -3.9999999999999996e-93 < x

    1. Initial program 71.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*79.8%

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

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

      \[\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 46.0%

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

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

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

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

Alternative 15: 28.1% accurate, 2.1× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-6}:\\ \;\;\;\;\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 -7.2e-6) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -7.2e-6) {
		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 <= (-7.2d-6)) 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 <= -7.2e-6) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -7.2e-6:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -7.2e-6)
		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 <= -7.2e-6)
		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, -7.2e-6], 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 -7.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{1}{x}\\

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.19999999999999967e-6 < x

    1. Initial program 72.4%

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

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

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

      \[\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 47.6%

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

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

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

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

Alternative 16: 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 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  9. Add Preprocessing

Alternative 17: 3.5% accurate, 17.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot \color{blue}{\frac{1}{x}} \]
  13. Taylor expanded in x around 0 3.4%

    \[\leadsto \color{blue}{1} \]
  14. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y):
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
end
function tmp = code(x, y)
	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}

Reproduce

?
herbie shell --seed 2024085 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))