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

Percentage Accurate: 68.3% → 99.8%
Time: 17.9s
Alternatives: 25
Speedup: 1.5×

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 25 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999998e125 < x < -8.0000000000000006e-18

    1. Initial program 68.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. *-commutative68.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-*r/87.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e-18 < x

    1. Initial program 72.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. times-frac86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e126 < x < -5.00000000000000036e-18

    1. Initial program 68.8%

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

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

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

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

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

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

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

    if -5.00000000000000036e-18 < x

    1. Initial program 72.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. times-frac86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 81.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.5000000000000005e-20 or -8.50000000000000013e-131 < x < -8.4999999999999994e-167

    1. Initial program 56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5000000000000005e-20 < x < -8.50000000000000013e-131

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 54.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. times-frac81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999986e-15 < x < -9.19999999999999995e-166

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999995e-166 < x

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

    if -9.50000000000000016e-63 < x < -6.7999999999999999e-131

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if -6.7999999999999999e-131 < x < -8.4999999999999994e-167

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\ \end{array} \]

Alternative 7: 81.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;x \leq -1.1 \cdot 10^{-130}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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

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


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

    1. Initial program 54.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. times-frac81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2000000000000001e-17 < x < -1.0999999999999999e-130

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

    if -1.0999999999999999e-130 < x < -8.4999999999999994e-167

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-17}:\\ \;\;\;\;\frac{\frac{1}{x + 1}}{\frac{x + y}{y}}\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{-130}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y + 1}\\ \end{array} \]

Alternative 8: 93.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{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 (<= x -2.2e-15)
   (/ (/ y (+ x (+ y (+ y 1.0)))) (+ x y))
   (* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -2.2e-15) {
		tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
	} else {
		tmp = (x / (x + y)) * ((y / (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 (x <= (-2.2d-15)) then
        tmp = (y / (x + (y + (y + 1.0d0)))) / (x + y)
    else
        tmp = (x / (x + y)) * ((y / (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 (x <= -2.2e-15) {
		tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
	} else {
		tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -2.2e-15:
		tmp = (y / (x + (y + (y + 1.0)))) / (x + y)
	else:
		tmp = (x / (x + y)) * ((y / (y + 1.0)) / (x + y))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -2.2e-15)
		tmp = Float64(Float64(y / Float64(x + Float64(y + Float64(y + 1.0)))) / Float64(x + y));
	else
		tmp = Float64(Float64(x / Float64(x + y)) * Float64(Float64(y / 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 (x <= -2.2e-15)
		tmp = (y / (x + (y + (y + 1.0)))) / (x + y);
	else
		tmp = (x / (x + y)) * ((y / (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[x, -2.2e-15], N[(N[(y / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + \left(y + 1\right)\right)}}{x + y}\\

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


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

    1. Initial program 54.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. times-frac81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999986e-15 < x

    1. Initial program 72.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. times-frac86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.6% accurate, 1.1× speedup?

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

\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 9500000000000:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.99999999999999959e-63 or -6.7999999999999999e-131 < x < -4.79999999999999986e-167

    1. Initial program 59.3%

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

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

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

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

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

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

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

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

    if -5.99999999999999959e-63 < x < -6.7999999999999999e-131 or -4.79999999999999986e-167 < x < 9.5e12

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

    if 9.5e12 < x

    1. Initial program 66.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-*r/82.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 22.7%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow222.7%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified22.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. associate-/r*29.3%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    8. Applied egg-rr29.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 9500000000000:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 10: 79.6% accurate, 1.1× speedup?

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

\mathbf{elif}\;x \leq -7.2 \cdot 10^{-131}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 490000000:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity64.6%

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

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

    if -4.2e-63 < x < -7.1999999999999999e-131 or -8.4999999999999994e-167 < x < 4.9e8

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999999e-131 < x < -8.4999999999999994e-167

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

    if 4.9e8 < x

    1. Initial program 66.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-*r/82.1%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 22.7%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow222.7%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified22.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. associate-/r*29.3%

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

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    8. Applied egg-rr29.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 490000000:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 11: 79.6% accurate, 1.1× speedup?

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

\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 4 \cdot 10^{-16}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity64.6%

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

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

    if -1.15e-62 < x < -6.7999999999999999e-131 or -8.4999999999999994e-167 < x < 3.9999999999999999e-16

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

    if -6.7999999999999999e-131 < x < -8.4999999999999994e-167

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

    if 3.9999999999999999e-16 < x

    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. times-frac89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-62}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + y}\\ \end{array} \]

Alternative 12: 81.9% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 50.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000014e50 < x < -8.4999999999999994e-167

    1. Initial program 89.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x < 2.6e14

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

    if 2.6e14 < x

    1. Initial program 66.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. times-frac88.5%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;x \leq 2.6 \cdot 10^{+14}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{1}{y}\\ \end{array} \]

Alternative 13: 81.0% accurate, 1.1× speedup?

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

\mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.40000000000000001e-16 or -6.7999999999999999e-131 < x < -8.4999999999999994e-167

    1. Initial program 56.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.40000000000000001e-16 < x < -6.7999999999999999e-131

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-16}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\ \end{array} \]

Alternative 14: 81.7% accurate, 1.1× speedup?

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

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

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

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


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

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

    if -1.60000000000000011e-62 < x < -7.0000000000000004e-131

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

    if -7.0000000000000004e-131 < x < -8.4999999999999994e-167

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{-62}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-131}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\ \end{array} \]

Alternative 15: 73.9% accurate, 1.3× speedup?

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

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{-110}:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 54.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-*r/69.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. *-commutative69.3%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 64.4%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow264.4%

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

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

    if -1 < x < -4.79999999999999986e-167

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified35.7%

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

    if -4.79999999999999986e-167 < x < 4.09999999999999983e-110

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

    if 4.09999999999999983e-110 < x

    1. Initial program 73.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 30.6%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow230.6%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified30.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. associate-/r*35.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
      2. div-inv35.5%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    8. Applied egg-rr35.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-110}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 16: 81.9% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -4.50000000000000014e50

    1. Initial program 50.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac79.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+79.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/79.6%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x}} \]
      2. clear-num99.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y + x}{x}}} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x} \]
      3. frac-times98.7%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}}{y + x} \]
      4. *-un-lft-identity98.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      5. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{\color{blue}{x + y}}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      6. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(\left(1 + x\right) + y\right)}}}{y + x} \]
      7. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(\color{blue}{\left(x + 1\right)} + y\right)}}{y + x} \]
      8. associate-+l+98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(x + \left(1 + y\right)\right)}}}{y + x} \]
      9. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \color{blue}{\left(y + 1\right)}\right)}}{y + x} \]
      10. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{x + y}} \]
    5. Applied egg-rr98.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
    6. Taylor expanded in x around inf 71.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \]

    if -4.50000000000000014e50 < x < -8.4999999999999994e-167

    1. Initial program 89.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac95.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+95.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/89.8%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Taylor expanded in y around 0 43.9%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]
    5. Step-by-step derivation
      1. *-commutative43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
      2. distribute-lft-in43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

        \[\leadsto \frac{y}{\color{blue}{x} + x \cdot x} \]
    6. Simplified43.9%

      \[\leadsto \color{blue}{\frac{y}{x + x \cdot x}} \]

    if -8.4999999999999994e-167 < x < 3.89999999999999977e-16

    1. Initial program 70.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac82.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity82.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/82.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity82.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+82.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified82.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 84.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative84.5%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified84.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 3.89999999999999977e-16 < x

    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. times-frac89.4%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+89.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/89.5%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Step-by-step derivation
      1. associate-*r/99.7%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x}} \]
      2. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y + x}{x}}} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x} \]
      3. frac-times99.6%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}}{y + x} \]
      4. *-un-lft-identity99.6%

        \[\leadsto \frac{\frac{\color{blue}{y}}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      5. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\frac{\color{blue}{x + y}}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      6. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(\left(1 + x\right) + y\right)}}}{y + x} \]
      7. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(\color{blue}{\left(x + 1\right)} + y\right)}}{y + x} \]
      8. associate-+l+99.6%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(x + \left(1 + y\right)\right)}}}{y + x} \]
      9. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \color{blue}{\left(y + 1\right)}\right)}}{y + x} \]
      10. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{x + y}} \]
    5. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
    6. Taylor expanded in y around inf 34.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;x \leq 3.9 \cdot 10^{-16}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + y}\\ \end{array} \]

Alternative 17: 81.9% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{y}}{y + 1}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -4.8e+50)
   (/ (/ y x) (+ x y))
   (if (<= x -8.5e-167) (/ y (+ x (* x x))) (/ (* x (/ 1.0 y)) (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.8e+50) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8.5e-167) {
		tmp = y / (x + (x * x));
	} else {
		tmp = (x * (1.0 / y)) / (y + 1.0);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-4.8d+50)) then
        tmp = (y / x) / (x + y)
    else if (x <= (-8.5d-167)) then
        tmp = y / (x + (x * x))
    else
        tmp = (x * (1.0d0 / y)) / (y + 1.0d0)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -4.8e+50) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8.5e-167) {
		tmp = y / (x + (x * x));
	} else {
		tmp = (x * (1.0 / y)) / (y + 1.0);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -4.8e+50:
		tmp = (y / x) / (x + y)
	elif x <= -8.5e-167:
		tmp = y / (x + (x * x))
	else:
		tmp = (x * (1.0 / y)) / (y + 1.0)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -4.8e+50)
		tmp = Float64(Float64(y / x) / Float64(x + y));
	elseif (x <= -8.5e-167)
		tmp = Float64(y / Float64(x + Float64(x * x)));
	else
		tmp = Float64(Float64(x * Float64(1.0 / y)) / Float64(y + 1.0));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4.8e+50)
		tmp = (y / x) / (x + y);
	elseif (x <= -8.5e-167)
		tmp = y / (x + (x * x));
	else
		tmp = (x * (1.0 / y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -4.8e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8000000000000004e50

    1. Initial program 50.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac79.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+79.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/79.6%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x}} \]
      2. clear-num99.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y + x}{x}}} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x} \]
      3. frac-times98.7%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}}{y + x} \]
      4. *-un-lft-identity98.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      5. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{\color{blue}{x + y}}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      6. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(\left(1 + x\right) + y\right)}}}{y + x} \]
      7. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(\color{blue}{\left(x + 1\right)} + y\right)}}{y + x} \]
      8. associate-+l+98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(x + \left(1 + y\right)\right)}}}{y + x} \]
      9. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \color{blue}{\left(y + 1\right)}\right)}}{y + x} \]
      10. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{x + y}} \]
    5. Applied egg-rr98.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
    6. Taylor expanded in x around inf 71.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \]

    if -4.8000000000000004e50 < x < -8.4999999999999994e-167

    1. Initial program 89.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac95.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+95.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/89.8%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Taylor expanded in y around 0 43.9%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]
    5. Step-by-step derivation
      1. *-commutative43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
      2. distribute-lft-in43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

        \[\leadsto \frac{y}{\color{blue}{x} + x \cdot x} \]
    6. Simplified43.9%

      \[\leadsto \color{blue}{\frac{y}{x + x \cdot x}} \]

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.8%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity84.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/84.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity84.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+84.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.8%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 62.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative62.8%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified62.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity62.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(y + 1\right)} \]
      2. times-frac65.1%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Step-by-step derivation
      1. associate-*r/65.1%

        \[\leadsto \color{blue}{\frac{\frac{1}{y} \cdot x}{y + 1}} \]
    10. Simplified65.1%

      \[\leadsto \color{blue}{\frac{\frac{1}{y} \cdot x}{y + 1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.8 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{1}{y}}{y + 1}\\ \end{array} \]

Alternative 18: 81.9% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot 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
 (if (<= x -4.5e+50)
   (/ (/ y x) (+ x y))
   (if (<= x -8.5e-167) (/ y (+ x (* x x))) (/ (/ x (+ y 1.0)) (+ x y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -4.5e+50) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8.5e-167) {
		tmp = y / (x + (x * 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) :: tmp
    if (x <= (-4.5d+50)) then
        tmp = (y / x) / (x + y)
    else if (x <= (-8.5d-167)) then
        tmp = y / (x + (x * 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 tmp;
	if (x <= -4.5e+50) {
		tmp = (y / x) / (x + y);
	} else if (x <= -8.5e-167) {
		tmp = y / (x + (x * x));
	} else {
		tmp = (x / (y + 1.0)) / (x + y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -4.5e+50:
		tmp = (y / x) / (x + y)
	elif x <= -8.5e-167:
		tmp = y / (x + (x * x))
	else:
		tmp = (x / (y + 1.0)) / (x + y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -4.5e+50)
		tmp = Float64(Float64(y / x) / Float64(x + y));
	elseif (x <= -8.5e-167)
		tmp = Float64(y / Float64(x + Float64(x * 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)
	tmp = 0.0;
	if (x <= -4.5e+50)
		tmp = (y / x) / (x + y);
	elseif (x <= -8.5e-167)
		tmp = y / (x + (x * 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_] := If[LessEqual[x, -4.5e+50], N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(y / N[(x + N[(x * x), $MachinePrecision]), $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}\;x \leq -4.5 \cdot 10^{+50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + y}\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.50000000000000014e50

    1. Initial program 50.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac79.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+79.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/79.6%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x}} \]
      2. clear-num99.8%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y + x}{x}}} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x} \]
      3. frac-times98.7%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}}{y + x} \]
      4. *-un-lft-identity98.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      5. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{\color{blue}{x + y}}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      6. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(\left(1 + x\right) + y\right)}}}{y + x} \]
      7. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(\color{blue}{\left(x + 1\right)} + y\right)}}{y + x} \]
      8. associate-+l+98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(x + \left(1 + y\right)\right)}}}{y + x} \]
      9. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \color{blue}{\left(y + 1\right)}\right)}}{y + x} \]
      10. +-commutative98.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{x + y}} \]
    5. Applied egg-rr98.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
    6. Taylor expanded in x around inf 71.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \]

    if -4.50000000000000014e50 < x < -8.4999999999999994e-167

    1. Initial program 89.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac95.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+95.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/89.8%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.7%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Taylor expanded in y around 0 43.9%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]
    5. Step-by-step derivation
      1. *-commutative43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
      2. distribute-lft-in43.9%

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

        \[\leadsto \frac{y}{\color{blue}{x} + x \cdot x} \]
    6. Simplified43.9%

      \[\leadsto \color{blue}{\frac{y}{x + x \cdot x}} \]

    if -8.4999999999999994e-167 < x

    1. Initial program 70.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.8%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+r+84.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
      3. associate-*l/77.9%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      4. times-frac99.8%

        \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{x}{\color{blue}{y + x}} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{x + y} \]
      6. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{\left(y + 1\right) + x}}}{x + y} \]
      7. associate-+l+99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{\color{blue}{y + \left(1 + x\right)}}}{x + y} \]
      8. +-commutative99.8%

        \[\leadsto \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{\color{blue}{y + x}} \]
    3. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(1 + x\right)}}{y + x}} \]
    4. Step-by-step derivation
      1. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x}} \]
      2. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{y + x}{x}}} \cdot \frac{y}{y + \left(1 + x\right)}}{y + x} \]
      3. frac-times99.7%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot y}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}}{y + x} \]
      4. *-un-lft-identity99.7%

        \[\leadsto \frac{\frac{\color{blue}{y}}{\frac{y + x}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      5. +-commutative99.7%

        \[\leadsto \frac{\frac{y}{\frac{\color{blue}{x + y}}{x} \cdot \left(y + \left(1 + x\right)\right)}}{y + x} \]
      6. +-commutative99.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(\left(1 + x\right) + y\right)}}}{y + x} \]
      7. +-commutative99.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(\color{blue}{\left(x + 1\right)} + y\right)}}{y + x} \]
      8. associate-+l+99.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \color{blue}{\left(x + \left(1 + y\right)\right)}}}{y + x} \]
      9. +-commutative99.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \color{blue}{\left(y + 1\right)}\right)}}{y + x} \]
      10. +-commutative99.7%

        \[\leadsto \frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{x + y}} \]
    5. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{\frac{x + y}{x} \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
    6. Taylor expanded in x around 0 65.5%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{x + y} \]
    7. Step-by-step derivation
      1. +-commutative65.5%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{x + y} \]
    8. Simplified65.5%

      \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{x + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{x + y}\\ \end{array} \]

Alternative 19: 72.3% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.0)
   (/ y (* x x))
   (if (<= x -8e-167) (- (/ y x) y) (if (<= x 8e-111) (/ x y) (/ x (* y y))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = y / (x * x);
	} else if (x <= -8e-167) {
		tmp = (y / x) - y;
	} else if (x <= 8e-111) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.0d0)) then
        tmp = y / (x * x)
    else if (x <= (-8d-167)) then
        tmp = (y / x) - y
    else if (x <= 8d-111) then
        tmp = x / y
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = y / (x * x);
	} else if (x <= -8e-167) {
		tmp = (y / x) - y;
	} else if (x <= 8e-111) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.0:
		tmp = y / (x * x)
	elif x <= -8e-167:
		tmp = (y / x) - y
	elif x <= 8e-111:
		tmp = x / y
	else:
		tmp = x / (y * y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.0)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= -8e-167)
		tmp = Float64(Float64(y / x) - y);
	elseif (x <= 8e-111)
		tmp = Float64(x / y);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.0)
		tmp = y / (x * x);
	elseif (x <= -8e-167)
		tmp = (y / x) - y;
	elseif (x <= 8e-111)
		tmp = x / y;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-167], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 8e-111], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq 8 \cdot 10^{-111}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1

    1. Initial program 54.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-*r/69.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. *-commutative69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in27.4%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult69.3%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified69.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 64.4%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow264.4%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified64.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

    if -1 < x < -8.00000000000000002e-167

    1. Initial program 87.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. Taylor expanded in y around 0 23.8%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(1 + x\right) \cdot {x}^{2}}} \]
    3. Step-by-step derivation
      1. *-commutative23.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{{x}^{2} \cdot \left(1 + x\right)}} \]
      2. unpow223.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right)} \cdot \left(1 + x\right)} \]
      3. +-commutative23.8%

        \[\leadsto \frac{x \cdot y}{\left(x \cdot x\right) \cdot \color{blue}{\left(x + 1\right)}} \]
    4. Simplified23.8%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right) \cdot \left(x + 1\right)}} \]
    5. Taylor expanded in x around 0 35.7%

      \[\leadsto \color{blue}{\frac{y}{x} + -1 \cdot y} \]
    6. Step-by-step derivation
      1. neg-mul-135.7%

        \[\leadsto \frac{y}{x} + \color{blue}{\left(-y\right)} \]
      2. unsub-neg35.7%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified35.7%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if -8.00000000000000002e-167 < x < 8.00000000000000071e-111

    1. Initial program 67.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac79.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity79.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/79.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity79.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+79.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified79.2%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 88.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative88.7%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified88.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 71.3%

      \[\leadsto \frac{x}{\color{blue}{y}} \]

    if 8.00000000000000071e-111 < x

    1. Initial program 73.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/86.5%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. *-commutative86.5%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in74.6%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def86.5%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult86.6%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified86.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 30.6%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow230.6%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified30.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification53.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-111}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 20: 74.1% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-197}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.0)
   (/ y (* x x))
   (if (<= x -8.5e-167)
     (- (/ y x) y)
     (if (<= x 1.55e-197) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = y / (x * x);
	} else if (x <= -8.5e-167) {
		tmp = (y / x) - y;
	} else if (x <= 1.55e-197) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.0d0)) then
        tmp = y / (x * x)
    else if (x <= (-8.5d-167)) then
        tmp = (y / x) - y
    else if (x <= 1.55d-197) then
        tmp = x / y
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = y / (x * x);
	} else if (x <= -8.5e-167) {
		tmp = (y / x) - y;
	} else if (x <= 1.55e-197) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.0:
		tmp = y / (x * x)
	elif x <= -8.5e-167:
		tmp = (y / x) - y
	elif x <= 1.55e-197:
		tmp = x / y
	else:
		tmp = (x / y) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.0)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= -8.5e-167)
		tmp = Float64(Float64(y / x) - y);
	elseif (x <= 1.55e-197)
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.0)
		tmp = y / (x * x);
	elseif (x <= -8.5e-167)
		tmp = (y / x) - y;
	elseif (x <= 1.55e-197)
		tmp = x / y;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8.5e-167], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.55e-197], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq 1.55 \cdot 10^{-197}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1

    1. Initial program 54.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-*r/69.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. *-commutative69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in27.4%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult69.3%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified69.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 64.4%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow264.4%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified64.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

    if -1 < x < -8.4999999999999994e-167

    1. Initial program 87.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. Taylor expanded in y around 0 23.8%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(1 + x\right) \cdot {x}^{2}}} \]
    3. Step-by-step derivation
      1. *-commutative23.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{{x}^{2} \cdot \left(1 + x\right)}} \]
      2. unpow223.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right)} \cdot \left(1 + x\right)} \]
      3. +-commutative23.8%

        \[\leadsto \frac{x \cdot y}{\left(x \cdot x\right) \cdot \color{blue}{\left(x + 1\right)}} \]
    4. Simplified23.8%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right) \cdot \left(x + 1\right)}} \]
    5. Taylor expanded in x around 0 35.7%

      \[\leadsto \color{blue}{\frac{y}{x} + -1 \cdot y} \]
    6. Step-by-step derivation
      1. neg-mul-135.7%

        \[\leadsto \frac{y}{x} + \color{blue}{\left(-y\right)} \]
      2. unsub-neg35.7%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified35.7%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if -8.4999999999999994e-167 < x < 1.55000000000000014e-197

    1. Initial program 64.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac77.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity77.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/77.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity77.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+77.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified77.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 89.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative89.0%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified89.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 75.7%

      \[\leadsto \frac{x}{\color{blue}{y}} \]

    if 1.55000000000000014e-197 < x

    1. Initial program 74.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-*r/86.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. *-commutative86.6%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in75.5%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def86.6%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult86.6%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified86.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 34.7%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow234.7%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified34.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. associate-/r*38.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
      2. div-inv38.8%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    8. Applied egg-rr38.8%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    9. Step-by-step derivation
      1. associate-*r/38.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot 1}{y}} \]
      2. *-rgt-identity38.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
    10. Simplified38.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification55.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-167}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq 1.55 \cdot 10^{-197}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 21: 78.0% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -430:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -430.0)
   (/ y (* x x))
   (if (<= x 8e+22) (/ x (* y (+ y 1.0))) (* (/ 1.0 y) (/ x y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -430.0) {
		tmp = y / (x * x);
	} else if (x <= 8e+22) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-430.0d0)) then
        tmp = y / (x * x)
    else if (x <= 8d+22) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (1.0d0 / y) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -430.0) {
		tmp = y / (x * x);
	} else if (x <= 8e+22) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (1.0 / y) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -430.0:
		tmp = y / (x * x)
	elif x <= 8e+22:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (1.0 / y) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -430.0)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= 8e+22)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(1.0 / y) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -430.0)
		tmp = y / (x * x);
	elseif (x <= 8e+22)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (1.0 / y) * (x / y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -430.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+22], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -430:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq 8 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -430

    1. Initial program 54.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-*r/69.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. *-commutative69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in27.4%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def69.3%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult69.3%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified69.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 64.4%

      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
    5. Step-by-step derivation
      1. unpow264.4%

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified64.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

    if -430 < x < 8e22

    1. Initial program 75.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity85.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/85.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity85.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+85.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified85.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 78.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative78.9%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified78.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 8e22 < x

    1. Initial program 65.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/81.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. *-commutative81.1%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in71.8%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def81.1%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult81.2%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified81.2%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 22.0%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow222.0%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified22.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. associate-/r*29.0%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
      2. div-inv29.0%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
    8. Applied egg-rr29.0%

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -430:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq 8 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 22: 55.1% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot 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-236)
   (- (/ y x) y)
   (if (<= y 0.75) (- (/ x y) x) (/ x (* y y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-236) {
		tmp = (y / x) - y;
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 3.1d-236) then
        tmp = (y / x) - y
    else if (y <= 0.75d0) then
        tmp = (x / y) - x
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-236) {
		tmp = (y / x) - y;
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.1e-236:
		tmp = (y / x) - y
	elif y <= 0.75:
		tmp = (x / y) - x
	else:
		tmp = x / (y * y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.1e-236)
		tmp = Float64(Float64(y / x) - y);
	elseif (y <= 0.75)
		tmp = Float64(Float64(x / y) - x);
	else
		tmp = Float64(x / Float64(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-236)
		tmp = (y / x) - y;
	elseif (y <= 0.75)
		tmp = (x / y) - x;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 3.1e-236], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 3.0999999999999998e-236

    1. Initial program 61.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Taylor expanded in y around 0 29.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(1 + x\right) \cdot {x}^{2}}} \]
    3. Step-by-step derivation
      1. *-commutative29.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{{x}^{2} \cdot \left(1 + x\right)}} \]
      2. unpow229.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right)} \cdot \left(1 + x\right)} \]
      3. +-commutative29.0%

        \[\leadsto \frac{x \cdot y}{\left(x \cdot x\right) \cdot \color{blue}{\left(x + 1\right)}} \]
    4. Simplified29.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right) \cdot \left(x + 1\right)}} \]
    5. Taylor expanded in x around 0 14.2%

      \[\leadsto \color{blue}{\frac{y}{x} + -1 \cdot y} \]
    6. Step-by-step derivation
      1. neg-mul-114.2%

        \[\leadsto \frac{y}{x} + \color{blue}{\left(-y\right)} \]
      2. unsub-neg14.2%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified14.2%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if 3.0999999999999998e-236 < y < 0.75

    1. Initial program 89.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac94.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity94.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/94.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity94.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+94.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified94.1%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 34.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative34.4%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified34.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 34.4%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-134.4%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg34.4%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified34.4%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 0.75 < y

    1. Initial program 65.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/81.7%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. *-commutative81.7%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in72.1%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def81.7%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult81.6%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified81.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 67.9%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow267.9%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified67.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification32.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 23: 33.9% accurate, 2.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (if (<= y 3.1e-236) (- (/ y x) y) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-236) {
		tmp = (y / x) - y;
	} else {
		tmp = x / y;
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 3.1d-236) then
        tmp = (y / x) - y
    else
        tmp = x / y
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (y <= 3.1e-236) {
		tmp = (y / x) - y;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if y <= 3.1e-236:
		tmp = (y / x) - y
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (y <= 3.1e-236)
		tmp = Float64(Float64(y / x) - y);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3.1e-236)
		tmp = (y / x) - y;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[y, 3.1e-236], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.0999999999999998e-236

    1. Initial program 61.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Taylor expanded in y around 0 29.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(1 + x\right) \cdot {x}^{2}}} \]
    3. Step-by-step derivation
      1. *-commutative29.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{{x}^{2} \cdot \left(1 + x\right)}} \]
      2. unpow229.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right)} \cdot \left(1 + x\right)} \]
      3. +-commutative29.0%

        \[\leadsto \frac{x \cdot y}{\left(x \cdot x\right) \cdot \color{blue}{\left(x + 1\right)}} \]
    4. Simplified29.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x \cdot x\right) \cdot \left(x + 1\right)}} \]
    5. Taylor expanded in x around 0 14.2%

      \[\leadsto \color{blue}{\frac{y}{x} + -1 \cdot y} \]
    6. Step-by-step derivation
      1. neg-mul-114.2%

        \[\leadsto \frac{y}{x} + \color{blue}{\left(-y\right)} \]
      2. unsub-neg14.2%

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified14.2%

      \[\leadsto \color{blue}{\frac{y}{x} - y} \]

    if 3.0999999999999998e-236 < y

    1. Initial program 75.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity89.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/89.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity89.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+89.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 53.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative53.3%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified53.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 32.0%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification22.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.1 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 24: 27.3% accurate, 3.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-11}:\\ \;\;\;\;\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 -8e-11) (/ 1.0 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -8e-11) {
		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 <= (-8d-11)) 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 <= -8e-11) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -8e-11:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -8e-11)
		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 <= -8e-11)
		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, -8e-11], 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 -8 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.99999999999999952e-11

    1. Initial program 54.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. times-frac81.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity81.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/81.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity81.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+81.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified81.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 54.5%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{1} \]
    5. Taylor expanded in x around inf 6.1%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot 1 \]

    if -7.99999999999999952e-11 < x

    1. Initial program 72.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. times-frac86.3%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.3%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 62.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative62.9%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified62.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 41.3%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification32.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-11}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 25: 25.7% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{x}{y} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y) :precision binary64 (/ x y))
assert(x < y);
double code(double x, double y) {
	return x / y;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / y
end function
assert x < y;
public static double code(double x, double y) {
	return x / y;
}
[x, y] = sort([x, y])
def code(x, y):
	return x / y
x, y = sort([x, y])
function code(x, y)
	return Float64(x / y)
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = x / y;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 68.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. times-frac85.1%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. /-rgt-identity85.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
    3. associate-/l/85.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
    4. *-lft-identity85.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
    5. associate-+l+85.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified85.1%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in x around 0 53.0%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  5. Step-by-step derivation
    1. +-commutative53.0%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
  6. Simplified53.0%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  7. Taylor expanded in y around 0 31.6%

    \[\leadsto \frac{x}{\color{blue}{y}} \]
  8. Final simplification31.6%

    \[\leadsto \frac{x}{y} \]

Developer target: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y):
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
end
function tmp = code(x, y)
	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}

Reproduce

?
herbie shell --seed 2023199 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))