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

Percentage Accurate: 68.3% → 99.8%
Time: 23.0s
Alternatives: 17
Speedup: 1.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 68.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.2% accurate, 0.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.59999999999999981e-36 < y < 4.6999999999999997e98

    1. Initial program 89.5%

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

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

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

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

    if 4.6999999999999997e98 < y

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.7% accurate, 0.8× speedup?

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

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


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

    1. Initial program 44.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000041e154 < x

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 86.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 44.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.5000000000000005e154 < x < -7.39999999999999972e-96

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

    if -7.39999999999999972e-96 < 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. associate-/l*80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 86.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 44.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35000000000000003e154 < x < -2.90000000000000002e-95

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

    if -2.90000000000000002e-95 < 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. associate-/l*80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 86.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 44.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000008e155 < x < -2.0499999999999999e-95

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999999e-95 < 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. associate-/l*80.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 91.6% accurate, 0.8× speedup?

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.34999999999999994e36 < y

    1. Initial program 54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 82.9% accurate, 1.1× speedup?

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

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


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

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

    if 1.8499999999999999e-106 < y

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 48.6% accurate, 1.4× speedup?

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

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


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

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

    if 1 < y

    1. Initial program 59.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 49.6% accurate, 1.4× speedup?

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

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


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

    1. Initial program 69.6%

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

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

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

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

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

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

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

    if 3.55e61 < x

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 79.1% accurate, 1.4× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 5.9 \cdot 10^{-108}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= y 5.9e-108) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (y <= 5.9e-108) {
		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 (y <= 5.9d-108) 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 (y <= 5.9e-108) {
		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 y <= 5.9e-108:
		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 (y <= 5.9e-108)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5.9e-108)
		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[y, 5.9e-108], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.9 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

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


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

    1. Initial program 69.4%

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

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

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

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

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

    if 5.89999999999999965e-108 < y

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

Alternative 13: 81.3% accurate, 1.4× speedup?

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

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


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

    1. Initial program 69.4%

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

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

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

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

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

    if 1.9e-106 < y

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 82.6% accurate, 1.4× speedup?

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

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


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

    1. Initial program 69.4%

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

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

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

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

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

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

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

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

    if 1.9e-106 < y

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 27.0% accurate, 1.7× speedup?

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

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


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

    1. Initial program 52.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{1 + x}} \]
    11. Step-by-step derivation
      1. +-commutative6.1%

        \[\leadsto \frac{1}{\color{blue}{x + 1}} \]
    12. Simplified6.1%

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

    if -2.5499999999999999e-31 < x

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 4.1% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  9. Final simplification4.2%

    \[\leadsto \frac{1}{y} \]
  10. Add Preprocessing

Alternative 17: 25.5% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  11. Final simplification25.0%

    \[\leadsto \frac{x}{y} \]
  12. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

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

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

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