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

Percentage Accurate: 68.6% → 99.8%
Time: 13.8s
Alternatives: 21
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 21 alternatives:

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

Initial Program: 68.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.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 67.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-frac87.9%

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

      \[\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.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. associate-+r+99.8%

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(x + 1\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: 83.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 53.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/75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999994e157 < x < -1.9000000000000001e34

    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-frac95.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-identity95.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/95.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-identity95.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+95.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.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 inf 83.6%

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

    if -1.9000000000000001e34 < x < -2.00000000000000007e-97

    1. Initial program 84.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/96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000007e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-97}:\\ \;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 3: 94.2% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\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 -6.2e+157)
   (/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
   (if (<= x -1.9e+34)
     (* (/ x (* (+ x y) (+ x y))) (/ y x))
     (if (<= x -1.15e-9)
       (* x (/ y (* (* x x) (+ x (+ 1.0 (* y 3.0))))))
       (* (/ x (+ x y)) (/ (/ y (+ y 1.0)) (+ x y)))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -6.2e+157) {
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	} else if (x <= -1.9e+34) {
		tmp = (x / ((x + y) * (x + y))) * (y / x);
	} else if (x <= -1.15e-9) {
		tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.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 <= (-6.2d+157)) then
        tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
    else if (x <= (-1.9d+34)) then
        tmp = (x / ((x + y) * (x + y))) * (y / x)
    else if (x <= (-1.15d-9)) then
        tmp = x * (y / ((x * x) * (x + (1.0d0 + (y * 3.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 <= -6.2e+157) {
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	} else if (x <= -1.9e+34) {
		tmp = (x / ((x + y) * (x + y))) * (y / x);
	} else if (x <= -1.15e-9) {
		tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.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 <= -6.2e+157:
		tmp = (-y / ((-1.0 - x) - y)) / (x + y)
	elif x <= -1.9e+34:
		tmp = (x / ((x + y) * (x + y))) * (y / x)
	elif x <= -1.15e-9:
		tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.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 <= -6.2e+157)
		tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y));
	elseif (x <= -1.9e+34)
		tmp = Float64(Float64(x / Float64(Float64(x + y) * Float64(x + y))) * Float64(y / x));
	elseif (x <= -1.15e-9)
		tmp = Float64(x * Float64(y / Float64(Float64(x * x) * Float64(x + Float64(1.0 + Float64(y * 3.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 <= -6.2e+157)
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	elseif (x <= -1.9e+34)
		tmp = (x / ((x + y) * (x + y))) * (y / x);
	elseif (x <= -1.15e-9)
		tmp = x * (y / ((x * x) * (x + (1.0 + (y * 3.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, -6.2e+157], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.9e+34], N[(N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.15e-9], N[(x * N[(y / N[(N[(x * x), $MachinePrecision] * N[(x + N[(1.0 + N[(y * 3.0), $MachinePrecision]), $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 -6.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\

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

\mathbf{elif}\;x \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\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 4 regimes
  2. if x < -6.1999999999999994e157

    1. Initial program 53.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/75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999994e157 < x < -1.9000000000000001e34

    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-frac95.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-identity95.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/95.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-identity95.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+95.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.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 inf 83.6%

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

    if -1.9000000000000001e34 < x < -1.15e-9

    1. Initial program 84.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/92.2%

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

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

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified92.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 x around inf 76.2%

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

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

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

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

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

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

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

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

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

    if -1.15e-9 < x

    1. Initial program 70.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.2%

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

        \[\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. associate-+r+99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \frac{y}{\left(x \cdot x\right) \cdot \left(x + \left(1 + y \cdot 3\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y} \cdot \frac{\frac{y}{y + 1}}{x + y}\\ \end{array} \]

Alternative 4: 94.2% accurate, 0.8× speedup?

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

\mathbf{elif}\;x \leq -1.02 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(y + \left(x + 1\right)\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 < -3.4000000000000001e110

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4000000000000001e110 < x < -1.0200000000000001e-16

    1. Initial program 82.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/91.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. *-commutative91.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-in84.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-def91.8%

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in91.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)}} \]
      4. associate-+r+91.7%

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

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

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

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

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

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

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

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

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

    if -1.0200000000000001e-16 < x

    1. Initial program 70.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-frac88.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+88.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/79.1%

        \[\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. associate-+r+99.8%

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

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

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

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

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

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

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

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

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

Alternative 5: 96.9% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\ \;\;\;\;\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 -6.2e+157)
   (/ (/ (- y) (- (- -1.0 x) y)) (+ x y))
   (if (<= x -2e-24)
     (* (/ 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 <= -6.2e+157) {
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	} else if (x <= -2e-24) {
		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 <= (-6.2d+157)) then
        tmp = (-y / (((-1.0d0) - x) - y)) / (x + y)
    else if (x <= (-2d-24)) 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 <= -6.2e+157) {
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	} else if (x <= -2e-24) {
		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 <= -6.2e+157:
		tmp = (-y / ((-1.0 - x) - y)) / (x + y)
	elif x <= -2e-24:
		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 <= -6.2e+157)
		tmp = Float64(Float64(Float64(-y) / Float64(Float64(-1.0 - x) - y)) / Float64(x + y));
	elseif (x <= -2e-24)
		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 <= -6.2e+157)
		tmp = (-y / ((-1.0 - x) - y)) / (x + y);
	elseif (x <= -2e-24)
		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, -6.2e+157], N[(N[((-y) / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-24], 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 -6.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\

\mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\
\;\;\;\;\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 < -6.1999999999999994e157

    1. Initial program 53.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/75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.1999999999999994e157 < x < -1.99999999999999985e-24

    1. Initial program 70.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-frac97.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-identity97.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/97.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-identity97.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+97.3%

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

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

    if -1.99999999999999985e-24 < 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-frac87.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+87.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/78.7%

        \[\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. associate-+r+99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-24}:\\ \;\;\;\;\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 6: 88.4% accurate, 0.9× speedup?

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

\mathbf{elif}\;y \leq 1.12 \cdot 10^{+140}:\\
\;\;\;\;\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}{x + y}\\


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3000000000000001e-167 < y < 1.1199999999999999e140

    1. Initial program 79.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-frac95.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-identity95.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/95.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-identity95.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+95.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.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 74.9%

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

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

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

    if 1.1199999999999999e140 < y

    1. Initial program 68.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-frac86.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+86.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/86.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-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. associate-+r+100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-167}:\\ \;\;\;\;\frac{\frac{-y}{\left(-1 - x\right) - y}}{x + y}\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{+140}:\\ \;\;\;\;\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}{x + y}\\ \end{array} \]

Alternative 7: 83.7% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -2.2 \cdot 10^{-97}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.5e157 or -1.9000000000000001e34 < x < -2.1999999999999999e-97

    1. Initial program 69.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/86.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. *-commutative86.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-in44.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.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-unmult86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5e157 < x < -1.9000000000000001e34

    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-frac95.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-identity95.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/95.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-identity95.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+95.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.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 inf 83.6%

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 8: 83.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.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. Taylor expanded in x around inf 54.8%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{x \cdot x} \cdot \frac{y}{\left(x + y\right) + 1}}\right)} - 1 \]
      4. pow178.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{{x}^{1}}}{x \cdot x} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      5. pow278.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{{x}^{1}}{\color{blue}{{x}^{2}}} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      6. pow-div78.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{x}^{\left(1 - 2\right)}} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      7. metadata-eval78.0%

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

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({x}^{-1} \cdot \frac{y}{y + \left(x + 1\right)}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def88.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-1} \cdot \frac{y}{y + \left(x + 1\right)}\right)\right)} \]
      2. expm1-log1p88.1%

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

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

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

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

    if -8.9999999999999997e157 < x < -1.9000000000000001e34

    1. Initial program 53.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-frac92.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-identity92.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/92.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-identity92.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+92.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.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 inf 80.6%

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

    if -1.9000000000000001e34 < x < -2.0200000000000001e-97

    1. Initial program 84.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.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 inf 63.7%

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

    if -2.0200000000000001e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9 \cdot 10^{+157}:\\ \;\;\;\;\frac{y \cdot \frac{1}{x}}{y + \left(x + 1\right)}\\ \mathbf{elif}\;x \leq -1.9 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -2.02 \cdot 10^{-97}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 9: 83.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.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-frac78.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+78.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/78.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.9%

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

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

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

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

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

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

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

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

    if -1.20000000000000004e158 < x < -1.9000000000000001e34

    1. Initial program 53.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-frac92.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-identity92.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/92.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-identity92.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+92.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.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 inf 80.6%

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

    if -1.9000000000000001e34 < x < -2.1999999999999999e-97

    1. Initial program 84.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.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 inf 63.7%

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 10: 82.1% accurate, 1.3× speedup?

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

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


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

    1. Initial program 65.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. Taylor expanded in x around inf 52.2%

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{x}{x \cdot x} \cdot \frac{y}{\left(x + y\right) + 1}}\right)} - 1 \]
      4. pow140.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{{x}^{1}}}{x \cdot x} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      5. pow240.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{{x}^{1}}{\color{blue}{{x}^{2}}} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      6. pow-div40.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{{x}^{\left(1 - 2\right)}} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      7. metadata-eval40.8%

        \[\leadsto e^{\mathsf{log1p}\left({x}^{\color{blue}{-1}} \cdot \frac{y}{\left(x + y\right) + 1}\right)} - 1 \]
      8. +-commutative40.8%

        \[\leadsto e^{\mathsf{log1p}\left({x}^{-1} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1}\right)} - 1 \]
      9. associate-+r+40.8%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({x}^{-1} \cdot \frac{y}{y + \left(x + 1\right)}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def73.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({x}^{-1} \cdot \frac{y}{y + \left(x + 1\right)}\right)\right)} \]
      2. expm1-log1p73.6%

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

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

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

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 11: 68.6% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -180000000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-203} \lor \neg \left(x \leq 2.2 \cdot 10^{-241}\right):\\ \;\;\;\;\frac{x}{y \cdot 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 (<= x -180000000000.0)
   (/ y (* x x))
   (if (or (<= x -8e-203) (not (<= x 2.2e-241))) (/ x (* y y)) (/ x y))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -180000000000.0) {
		tmp = y / (x * x);
	} else if ((x <= -8e-203) || !(x <= 2.2e-241)) {
		tmp = x / (y * 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 (x <= (-180000000000.0d0)) then
        tmp = y / (x * x)
    else if ((x <= (-8d-203)) .or. (.not. (x <= 2.2d-241))) then
        tmp = x / (y * 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 (x <= -180000000000.0) {
		tmp = y / (x * x);
	} else if ((x <= -8e-203) || !(x <= 2.2e-241)) {
		tmp = x / (y * y);
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -180000000000.0:
		tmp = y / (x * x)
	elif (x <= -8e-203) or not (x <= 2.2e-241):
		tmp = x / (y * y)
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -180000000000.0)
		tmp = Float64(y / Float64(x * x));
	elseif ((x <= -8e-203) || !(x <= 2.2e-241))
		tmp = Float64(x / Float64(y * 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 (x <= -180000000000.0)
		tmp = y / (x * x);
	elseif ((x <= -8e-203) || ~((x <= 2.2e-241)))
		tmp = x / (y * 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[x, -180000000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8e-203], N[Not[LessEqual[x, 2.2e-241]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -180000000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-203} \lor \neg \left(x \leq 2.2 \cdot 10^{-241}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


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

    1. Initial program 57.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/72.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. *-commutative72.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-in32.3%

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified72.0%

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

    if -1.8e11 < x < -8.0000000000000003e-203 or 2.1999999999999999e-241 < 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.4%

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

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

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

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

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

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

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

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

    if -8.0000000000000003e-203 < x < 2.1999999999999999e-241

    1. Initial program 61.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-frac77.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-identity77.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/77.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-identity77.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+77.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified77.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 89.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -180000000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-203} \lor \neg \left(x \leq 2.2 \cdot 10^{-241}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 12: 70.1% accurate, 1.5× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -15200000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-201}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-240}:\\ \;\;\;\;\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 -15200000000.0)
   (/ y (* x x))
   (if (<= x -1.45e-201)
     (/ x (* y y))
     (if (<= x 1.65e-240) (/ x y) (/ (/ x y) y)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -15200000000.0) {
		tmp = y / (x * x);
	} else if (x <= -1.45e-201) {
		tmp = x / (y * y);
	} else if (x <= 1.65e-240) {
		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 <= (-15200000000.0d0)) then
        tmp = y / (x * x)
    else if (x <= (-1.45d-201)) then
        tmp = x / (y * y)
    else if (x <= 1.65d-240) 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 <= -15200000000.0) {
		tmp = y / (x * x);
	} else if (x <= -1.45e-201) {
		tmp = x / (y * y);
	} else if (x <= 1.65e-240) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -15200000000.0:
		tmp = y / (x * x)
	elif x <= -1.45e-201:
		tmp = x / (y * y)
	elif x <= 1.65e-240:
		tmp = x / y
	else:
		tmp = (x / y) / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -15200000000.0)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= -1.45e-201)
		tmp = Float64(x / Float64(y * y));
	elseif (x <= 1.65e-240)
		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 <= -15200000000.0)
		tmp = y / (x * x);
	elseif (x <= -1.45e-201)
		tmp = x / (y * y);
	elseif (x <= 1.65e-240)
		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, -15200000000.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-201], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-240], 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 -15200000000:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{-201}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq 1.65 \cdot 10^{-240}:\\
\;\;\;\;\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.52e10

    1. Initial program 57.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/72.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. *-commutative72.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-in32.3%

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified72.0%

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

    if -1.52e10 < x < -1.4500000000000001e-201

    1. Initial program 82.8%

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

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

        \[\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-in84.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-def95.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-unmult95.5%

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified40.5%

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

    if -1.4500000000000001e-201 < x < 1.6500000000000001e-240

    1. Initial program 62.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-frac78.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-identity78.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/78.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-identity78.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+78.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified78.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 89.6%

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

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

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

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

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

    if 1.6500000000000001e-240 < x

    1. Initial program 69.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/82.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. *-commutative82.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-in70.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-def82.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-unmult82.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    9. Step-by-step derivation
      1. unpow234.0%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
      2. associate-/r*37.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
    10. Simplified37.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -15200000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-201}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-240}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 13: 77.5% accurate, 1.5× speedup?

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

\mathbf{elif}\;x \leq 2.1 \cdot 10^{+16}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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


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

    1. Initial program 57.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/72.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. *-commutative72.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-in32.3%

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified72.0%

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

    if -1.16e10 < x < 2.1e16

    1. Initial program 76.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.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-identity89.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/89.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-identity89.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+89.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.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 70.3%

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

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

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

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

    if 2.1e16 < x

    1. Initial program 62.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
      2. associate-/r*25.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
    10. Simplified25.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -11600000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{+16}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 14: 80.1% accurate, 1.5× speedup?

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

\mathbf{elif}\;x \leq 1.55 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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


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

    1. Initial program 65.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-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity89.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/89.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-identity89.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+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.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 y around 0 69.9%

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

    if -2.1999999999999999e-97 < x < 1.55e17

    1. Initial program 73.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac87.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-identity87.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/87.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-identity87.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+87.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified87.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 77.3%

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

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

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

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

    if 1.55e17 < x

    1. Initial program 62.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
      2. associate-/r*25.6%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y}} \]
    10. Simplified25.6%

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

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

Alternative 15: 82.1% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.4e14 < x < -2.1999999999999999e-97

    1. Initial program 88.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 y around 0 64.8%

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 16: 82.1% accurate, 1.5× speedup?

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

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


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

    1. Initial program 65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 17: 80.1% accurate, 1.9× speedup?

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

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


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

    1. Initial program 65.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-frac89.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity89.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/89.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-identity89.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+89.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.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 y around 0 69.9%

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

    if -2.1999999999999999e-97 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-identity86.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/86.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-identity86.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+86.8%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 55.3%

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

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

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

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

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

Alternative 18: 47.3% accurate, 2.4× speedup?

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

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


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

    1. Initial program 66.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac87.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-identity87.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/87.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-identity87.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+87.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified87.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 37.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified16.8%

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

    if 0.76000000000000001 < y

    1. Initial program 72.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified67.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 19: 28.1% accurate, 3.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -0.96:\\ \;\;\;\;\frac{0.3333333333333333}{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 -0.96) (/ 0.3333333333333333 x) (/ x y)))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -0.96) {
		tmp = 0.3333333333333333 / 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 <= (-0.96d0)) then
        tmp = 0.3333333333333333d0 / 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 <= -0.96) {
		tmp = 0.3333333333333333 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -0.96:
		tmp = 0.3333333333333333 / x
	else:
		tmp = x / y
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -0.96)
		tmp = Float64(0.3333333333333333 / 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 <= -0.96)
		tmp = 0.3333333333333333 / 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, -0.96], N[(0.3333333333333333 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.96:\\
\;\;\;\;\frac{0.3333333333333333}{x}\\

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


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

    1. Initial program 59.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.95999999999999996 < x

    1. Initial program 71.1%

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

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified88.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 54.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.96:\\ \;\;\;\;\frac{0.3333333333333333}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 20: 4.3% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.3333333333333333}{x}} \]
  8. Final simplification4.4%

    \[\leadsto \frac{0.3333333333333333}{x} \]

Alternative 21: 3.5% accurate, 17.0× speedup?

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

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

      \[\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.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. associate-+r+99.8%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  8. Final simplification3.4%

    \[\leadsto 1 \]

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 2023238 
(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))))