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

Percentage Accurate: 69.1% → 99.8%
Time: 13.6s
Alternatives: 22
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 22 alternatives:

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

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

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-/r*N/A

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

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

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

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

      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
    11. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
    12. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
    13. associate-+r+N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
    14. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
    15. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
    16. +-lowering-+.f6499.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
  4. Applied egg-rr99.8%

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

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

Alternative 2: 88.1% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 52.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. associate-/r*N/A

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

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

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

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

        \[\leadsto \frac{x \cdot \frac{y}{x + y}}{\left(\left(x + y\right) + 1\right) \cdot \color{blue}{\left(x + y\right)}} \]
      6. times-fracN/A

        \[\leadsto \frac{x}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\left(x + y\right) + 1}\right), \color{blue}{\left(\frac{\frac{y}{x + y}}{x + y}\right)}\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\left(x + y\right) + 1\right)\right), \left(\frac{\color{blue}{\frac{y}{x + y}}}{x + y}\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(\frac{\frac{y}{x + \color{blue}{y}}}{x + y}\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + y\right)}\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + y\right)\right)\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + y\right)\right)\right) \]
      15. +-lowering-+.f6499.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    4. Applied egg-rr99.8%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, y\right)\right)\right) \]
    6. Step-by-step derivation
      1. Simplified99.8%

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

      if -7e10 < x < -3.2e-236

      1. Initial program 81.8%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. associate-/r*N/A

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

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

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

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

          \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        9. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        12. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        13. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
        15. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
        16. +-lowering-+.f6499.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
      4. Applied egg-rr99.8%

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

        \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
      6. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
        2. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
        3. +-lowering-+.f6447.1%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
      7. Simplified47.1%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \color{blue}{\left(x \cdot \left(1 + \frac{y}{x}\right)\right)}\right) \]
      9. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{*.f64}\left(x, \color{blue}{\left(1 + \frac{y}{x}\right)}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{y}{x}\right)}\right)\right)\right) \]
        3. /-lowering-/.f6454.9%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(y, \color{blue}{x}\right)\right)\right)\right) \]
      10. Simplified54.9%

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

      if -3.2e-236 < x

      1. Initial program 61.3%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. associate-/r*N/A

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

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

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

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

          \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
        6. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
        7. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
        8. *-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        9. associate-/l*N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        11. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        12. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
        13. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
        14. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
        15. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
        16. +-lowering-+.f6499.8%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
      4. Applied egg-rr99.8%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
      6. Step-by-step derivation
        1. Simplified48.6%

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

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

      Alternative 3: 80.9% accurate, 0.8× speedup?

      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3.35 \cdot 10^{+69}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 4.05 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{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 -3.35e+69)
         (/ (/ y x) x)
         (if (<= y 3.2e-190)
           (/ y (* x (+ x 1.0)))
           (if (<= y 4.05e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x))))))
      assert(x < y);
      double code(double x, double y) {
      	double tmp;
      	if (y <= -3.35e+69) {
      		tmp = (y / x) / x;
      	} else if (y <= 3.2e-190) {
      		tmp = y / (x * (x + 1.0));
      	} else if (y <= 4.05e+15) {
      		tmp = x / (y * (y + 1.0));
      	} else {
      		tmp = (x / y) / (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 <= (-3.35d+69)) then
              tmp = (y / x) / x
          else if (y <= 3.2d-190) then
              tmp = y / (x * (x + 1.0d0))
          else if (y <= 4.05d+15) then
              tmp = x / (y * (y + 1.0d0))
          else
              tmp = (x / y) / (y + x)
          end if
          code = tmp
      end function
      
      assert x < y;
      public static double code(double x, double y) {
      	double tmp;
      	if (y <= -3.35e+69) {
      		tmp = (y / x) / x;
      	} else if (y <= 3.2e-190) {
      		tmp = y / (x * (x + 1.0));
      	} else if (y <= 4.05e+15) {
      		tmp = x / (y * (y + 1.0));
      	} else {
      		tmp = (x / y) / (y + x);
      	}
      	return tmp;
      }
      
      [x, y] = sort([x, y])
      def code(x, y):
      	tmp = 0
      	if y <= -3.35e+69:
      		tmp = (y / x) / x
      	elif y <= 3.2e-190:
      		tmp = y / (x * (x + 1.0))
      	elif y <= 4.05e+15:
      		tmp = x / (y * (y + 1.0))
      	else:
      		tmp = (x / y) / (y + x)
      	return tmp
      
      x, y = sort([x, y])
      function code(x, y)
      	tmp = 0.0
      	if (y <= -3.35e+69)
      		tmp = Float64(Float64(y / x) / x);
      	elseif (y <= 3.2e-190)
      		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
      	elseif (y <= 4.05e+15)
      		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
      	else
      		tmp = Float64(Float64(x / y) / Float64(y + x));
      	end
      	return tmp
      end
      
      x, y = num2cell(sort([x, y])){:}
      function tmp_2 = code(x, y)
      	tmp = 0.0;
      	if (y <= -3.35e+69)
      		tmp = (y / x) / x;
      	elseif (y <= 3.2e-190)
      		tmp = y / (x * (x + 1.0));
      	elseif (y <= 4.05e+15)
      		tmp = x / (y * (y + 1.0));
      	else
      		tmp = (x / y) / (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, -3.35e+69], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[y, 3.2e-190], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.05e+15], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      [x, y] = \mathsf{sort}([x, y])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -3.35 \cdot 10^{+69}:\\
      \;\;\;\;\frac{\frac{y}{x}}{x}\\
      
      \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\
      \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
      
      \mathbf{elif}\;y \leq 4.05 \cdot 10^{+15}:\\
      \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{x}{y}}{y + x}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if y < -3.35000000000000005e69

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left({x}^{3}\right)}\right) \]
        4. Step-by-step derivation
          1. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
          5. *-lowering-*.f641.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
        5. Simplified1.4%

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

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

            \[\leadsto \frac{\frac{\frac{x \cdot y}{x}}{x}}{\color{blue}{x}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{y \cdot x}{x}}{x}}{x} \]
          4. associate-/l*N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{x}}{x}}{x} \]
          5. *-inversesN/A

            \[\leadsto \frac{\frac{y \cdot 1}{x}}{x} \]
          6. *-rgt-identityN/A

            \[\leadsto \frac{\frac{y}{x}}{x} \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right) \]
          8. /-lowering-/.f6428.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right) \]
        7. Applied egg-rr28.4%

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

        if -3.35000000000000005e69 < y < 3.2000000000000001e-190

        1. Initial program 67.7%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
          4. +-lowering-+.f6479.8%

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
        5. Simplified79.8%

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

        if 3.2000000000000001e-190 < y < 4.05e15

        1. Initial program 82.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. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
          4. +-lowering-+.f6435.5%

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
        5. Simplified35.5%

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

        if 4.05e15 < 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. associate-/r*N/A

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

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

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

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

            \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
          6. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          9. associate-/l*N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          11. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          12. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          13. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
          15. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
          16. +-lowering-+.f6499.9%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
        4. Applied egg-rr99.9%

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

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{y}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
        6. Step-by-step derivation
          1. /-lowering-/.f6475.8%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, y\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
        7. Simplified75.8%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.35 \cdot 10^{+69}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 4.05 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + x}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 4: 80.8% accurate, 0.8× speedup?

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left({x}^{3}\right)}\right) \]
        4. Step-by-step derivation
          1. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
          5. *-lowering-*.f641.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
        5. Simplified1.4%

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

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

            \[\leadsto \frac{\frac{\frac{x \cdot y}{x}}{x}}{\color{blue}{x}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{y \cdot x}{x}}{x}}{x} \]
          4. associate-/l*N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{x}}{x}}{x} \]
          5. *-inversesN/A

            \[\leadsto \frac{\frac{y \cdot 1}{x}}{x} \]
          6. *-rgt-identityN/A

            \[\leadsto \frac{\frac{y}{x}}{x} \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right) \]
          8. /-lowering-/.f6428.4%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right) \]
        7. Applied egg-rr28.4%

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

        if -3.49999999999999987e69 < y < 3.2000000000000001e-190

        1. Initial program 67.7%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
          4. +-lowering-+.f6479.8%

            \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
        5. Simplified79.8%

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

        if 3.2000000000000001e-190 < y < 3e103

        1. Initial program 79.5%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
          4. +-lowering-+.f6439.4%

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
        5. Simplified39.4%

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

        if 3e103 < y

        1. Initial program 59.8%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in y around inf

          \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
        4. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
          3. *-lowering-*.f6480.3%

            \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
        5. Simplified80.3%

          \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
        6. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y}\right), \color{blue}{y}\right) \]
          3. /-lowering-/.f6491.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, y\right), y\right) \]
        7. Applied egg-rr91.7%

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

      Alternative 5: 76.9% accurate, 0.8× speedup?

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

        1. Initial program 57.0%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left({x}^{3}\right)}\right) \]
        4. Step-by-step derivation
          1. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
          2. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
          5. *-lowering-*.f6420.7%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
        5. Simplified20.7%

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

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

            \[\leadsto \frac{\frac{\frac{x \cdot y}{x}}{x}}{\color{blue}{x}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{\frac{\frac{y \cdot x}{x}}{x}}{x} \]
          4. associate-/l*N/A

            \[\leadsto \frac{\frac{y \cdot \frac{x}{x}}{x}}{x} \]
          5. *-inversesN/A

            \[\leadsto \frac{\frac{y \cdot 1}{x}}{x} \]
          6. *-rgt-identityN/A

            \[\leadsto \frac{\frac{y}{x}}{x} \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right) \]
          8. /-lowering-/.f6439.2%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right) \]
        7. Applied egg-rr39.2%

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

        if -4.6e-188 < y < 3.2000000000000001e-190

        1. Initial program 55.9%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. associate-/r*N/A

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

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

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

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

            \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
          6. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
          7. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
          8. *-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          9. associate-/l*N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          11. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          12. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
          13. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
          14. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
          15. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
          16. +-lowering-+.f6499.9%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
        4. Applied egg-rr99.9%

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

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
        6. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
          2. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
          3. +-lowering-+.f6486.6%

            \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
        7. Simplified86.6%

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

          \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(x, y\right)\right) \]
        9. Step-by-step derivation
          1. Simplified72.5%

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

          if 3.2000000000000001e-190 < y < 3.9999999999999999e101

          1. Initial program 79.5%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
            4. +-lowering-+.f6439.4%

              \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
          5. Simplified39.4%

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

          if 3.9999999999999999e101 < y

          1. Initial program 59.8%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in y around inf

            \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
          4. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
            2. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
            3. *-lowering-*.f6480.3%

              \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
          5. Simplified80.3%

            \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
          6. Step-by-step derivation
            1. associate-/r*N/A

              \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y}\right), \color{blue}{y}\right) \]
            3. /-lowering-/.f6491.7%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, y\right), y\right) \]
          7. Applied egg-rr91.7%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{-188}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+101}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
        12. Add Preprocessing

        Alternative 6: 75.9% accurate, 0.8× speedup?

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

          1. Initial program 57.0%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in x around inf

            \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left({x}^{3}\right)}\right) \]
          4. Step-by-step derivation
            1. cube-multN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
            2. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
            4. unpow2N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
            5. *-lowering-*.f6420.7%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
          5. Simplified20.7%

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

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

              \[\leadsto \frac{\frac{\frac{x \cdot y}{x}}{x}}{\color{blue}{x}} \]
            3. *-commutativeN/A

              \[\leadsto \frac{\frac{\frac{y \cdot x}{x}}{x}}{x} \]
            4. associate-/l*N/A

              \[\leadsto \frac{\frac{y \cdot \frac{x}{x}}{x}}{x} \]
            5. *-inversesN/A

              \[\leadsto \frac{\frac{y \cdot 1}{x}}{x} \]
            6. *-rgt-identityN/A

              \[\leadsto \frac{\frac{y}{x}}{x} \]
            7. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right) \]
            8. /-lowering-/.f6439.2%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right) \]
          7. Applied egg-rr39.2%

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

          if -8.99999999999999986e-188 < y < 3.2000000000000001e-190

          1. Initial program 55.9%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. associate-/r*N/A

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

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

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

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

              \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
            6. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
            7. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
            8. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
            9. associate-/l*N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
            11. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
            12. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
            13. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
            14. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
            15. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
            16. +-lowering-+.f6499.9%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
          4. Applied egg-rr99.9%

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

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
          6. Step-by-step derivation
            1. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
            2. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
            3. +-lowering-+.f6486.6%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
          7. Simplified86.6%

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

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(x, y\right)\right) \]
          9. Step-by-step derivation
            1. Simplified72.5%

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

            if 3.2000000000000001e-190 < y < 1

            1. Initial program 84.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. Taylor expanded in x around 0

              \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
              2. *-lowering-*.f64N/A

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
              4. +-lowering-+.f6436.2%

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
            5. Simplified36.2%

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

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

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
            8. Simplified34.9%

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

            if 1 < y

            1. Initial program 63.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. Taylor expanded in y around inf

              \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
              2. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
              3. *-lowering-*.f6467.1%

                \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
            5. Simplified67.1%

              \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
            6. Step-by-step derivation
              1. associate-/r*N/A

                \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y}\right), \color{blue}{y}\right) \]
              3. /-lowering-/.f6474.1%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, y\right), y\right) \]
            7. Applied egg-rr74.1%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{-188}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
          12. Add Preprocessing

          Alternative 7: 74.4% accurate, 0.8× speedup?

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

            1. Initial program 57.0%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
            4. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left({x}^{2}\right)}\right) \]
              2. unpow2N/A

                \[\leadsto \mathsf{/.f64}\left(y, \left(x \cdot \color{blue}{x}\right)\right) \]
              3. *-lowering-*.f6432.1%

                \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
            5. Simplified32.1%

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

            if -1.4e-187 < y < 2.6999999999999999e-190

            1. Initial program 55.9%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. associate-/r*N/A

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

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

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

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

                \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
              6. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
              7. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
              8. *-commutativeN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
              9. associate-/l*N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
              11. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
              12. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
              13. associate-+r+N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
              14. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
              15. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
              16. +-lowering-+.f6499.9%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
            4. Applied egg-rr99.9%

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

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
            6. Step-by-step derivation
              1. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
              2. +-commutativeN/A

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
              3. +-lowering-+.f6486.6%

                \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
            7. Simplified86.6%

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

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(x, y\right)\right) \]
            9. Step-by-step derivation
              1. Simplified72.5%

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

              if 2.6999999999999999e-190 < y < 1

              1. Initial program 84.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. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                2. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                3. +-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                4. +-lowering-+.f6436.2%

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
              5. Simplified36.2%

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

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

                  \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
              8. Simplified34.9%

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

              if 1 < y

              1. Initial program 63.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. Taylor expanded in y around inf

                \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
                2. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
                3. *-lowering-*.f6467.1%

                  \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
              5. Simplified67.1%

                \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
              6. Step-by-step derivation
                1. associate-/r*N/A

                  \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y}\right), \color{blue}{y}\right) \]
                3. /-lowering-/.f6474.1%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, y\right), y\right) \]
              7. Applied egg-rr74.1%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-187}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
            12. Add Preprocessing

            Alternative 8: 72.2% accurate, 0.8× speedup?

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

              1. Initial program 57.0%

                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
              2. Add Preprocessing
              3. Taylor expanded in x around inf

                \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
              4. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left({x}^{2}\right)}\right) \]
                2. unpow2N/A

                  \[\leadsto \mathsf{/.f64}\left(y, \left(x \cdot \color{blue}{x}\right)\right) \]
                3. *-lowering-*.f6432.1%

                  \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
              5. Simplified32.1%

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

              if -1.85000000000000005e-187 < y < 3.2000000000000001e-190

              1. Initial program 55.9%

                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. associate-/r*N/A

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

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

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

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

                  \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                6. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                7. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                9. associate-/l*N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                11. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                12. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                13. associate-+r+N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                14. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                15. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                16. +-lowering-+.f6499.9%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
              4. Applied egg-rr99.9%

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

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
              6. Step-by-step derivation
                1. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                2. +-commutativeN/A

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                3. +-lowering-+.f6486.6%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
              7. Simplified86.6%

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

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{y}, \mathsf{+.f64}\left(x, y\right)\right) \]
              9. Step-by-step derivation
                1. Simplified72.5%

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

                if 3.2000000000000001e-190 < y < 1

                1. Initial program 84.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. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                  4. +-lowering-+.f6436.2%

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                5. Simplified36.2%

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

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

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
                8. Simplified34.9%

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

                if 1 < y

                1. Initial program 63.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. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
                  3. *-lowering-*.f6467.1%

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
                5. Simplified67.1%

                  \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
              10. Recombined 4 regimes into one program.
              11. Final simplification49.2%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{-187}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]
              12. Add Preprocessing

              Alternative 9: 72.2% accurate, 0.8× speedup?

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

                1. Initial program 57.0%

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left({x}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(y, \left(x \cdot \color{blue}{x}\right)\right) \]
                  3. *-lowering-*.f6432.1%

                    \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right) \]
                5. Simplified32.1%

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

                if -2e-187 < y < 3.2000000000000001e-190

                1. Initial program 55.9%

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. Add Preprocessing
                3. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                  4. +-lowering-+.f6486.6%

                    \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                5. Simplified86.6%

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

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

                    \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{x}\right) \]
                8. Simplified72.5%

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

                if 3.2000000000000001e-190 < y < 1

                1. Initial program 84.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. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                  4. +-lowering-+.f6436.2%

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                5. Simplified36.2%

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

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

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
                8. Simplified34.9%

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

                if 1 < y

                1. Initial program 63.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. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                4. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
                  2. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
                  3. *-lowering-*.f6467.1%

                    \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
                5. Simplified67.1%

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

              Alternative 10: 98.7% accurate, 0.8× speedup?

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

                1. Initial program 55.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. associate-/r*N/A

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

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

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

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

                    \[\leadsto \frac{x \cdot \frac{y}{x + y}}{\left(\left(x + y\right) + 1\right) \cdot \color{blue}{\left(x + y\right)}} \]
                  6. times-fracN/A

                    \[\leadsto \frac{x}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\left(x + y\right) + 1}\right), \color{blue}{\left(\frac{\frac{y}{x + y}}{x + y}\right)}\right) \]
                  8. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\left(x + y\right) + 1\right)\right), \left(\frac{\color{blue}{\frac{y}{x + y}}}{x + y}\right)\right) \]
                  9. associate-+r+N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(\frac{\frac{y}{x + \color{blue}{y}}}{x + y}\right)\right) \]
                  12. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + y\right)}\right)\right) \]
                  13. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + y\right)\right)\right) \]
                  14. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + y\right)\right)\right) \]
                  15. +-lowering-+.f6499.8%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
                4. Applied egg-rr99.8%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, y\right)\right)\right) \]
                6. Step-by-step derivation
                  1. Simplified97.4%

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

                  if -1 < x

                  1. Initial program 65.8%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{x \cdot \frac{y}{x + y}}{\left(\left(x + y\right) + 1\right) \cdot \color{blue}{\left(x + y\right)}} \]
                    6. times-fracN/A

                      \[\leadsto \frac{x}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\left(x + y\right) + 1}\right), \color{blue}{\left(\frac{\frac{y}{x + y}}{x + y}\right)}\right) \]
                    8. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\left(x + y\right) + 1\right)\right), \left(\frac{\color{blue}{\frac{y}{x + y}}}{x + y}\right)\right) \]
                    9. associate-+r+N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                    10. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                    11. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(\frac{\frac{y}{x + \color{blue}{y}}}{x + y}\right)\right) \]
                    12. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + y\right)}\right)\right) \]
                    13. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + y\right)\right)\right) \]
                    14. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + y\right)\right)\right) \]
                    15. +-lowering-+.f6499.7%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
                  4. Applied egg-rr99.7%

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

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{x}{1 + y}\right)}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, y\right)\right)\right) \]
                  6. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(1 + y\right)\right), \mathsf{/.f64}\left(\color{blue}{\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right)}, \mathsf{+.f64}\left(x, y\right)\right)\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \color{blue}{\mathsf{+.f64}\left(x, y\right)}\right), \mathsf{+.f64}\left(x, y\right)\right)\right) \]
                    3. +-lowering-+.f6486.6%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \color{blue}{\mathsf{+.f64}\left(x, y\right)}\right), \mathsf{+.f64}\left(x, y\right)\right)\right) \]
                  7. Simplified86.6%

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

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

                Alternative 11: 80.8% accurate, 1.0× speedup?

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

                  1. Initial program 38.7%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in x around inf

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \color{blue}{\left({x}^{3}\right)}\right) \]
                  4. Step-by-step derivation
                    1. cube-multN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot \color{blue}{\left(x \cdot x\right)}\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \left(x \cdot {x}^{\color{blue}{2}}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \color{blue}{\left({x}^{2}\right)}\right)\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{x}\right)\right)\right) \]
                    5. *-lowering-*.f643.2%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right) \]
                  5. Simplified3.2%

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

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

                      \[\leadsto \frac{\frac{\frac{x \cdot y}{x}}{x}}{\color{blue}{x}} \]
                    3. *-commutativeN/A

                      \[\leadsto \frac{\frac{\frac{y \cdot x}{x}}{x}}{x} \]
                    4. associate-/l*N/A

                      \[\leadsto \frac{\frac{y \cdot \frac{x}{x}}{x}}{x} \]
                    5. *-inversesN/A

                      \[\leadsto \frac{\frac{y \cdot 1}{x}}{x} \]
                    6. *-rgt-identityN/A

                      \[\leadsto \frac{\frac{y}{x}}{x} \]
                    7. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{x}\right) \]
                    8. /-lowering-/.f6429.7%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), x\right) \]
                  7. Applied egg-rr29.7%

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

                  if -7.0000000000000002e65 < y < 3.2000000000000001e-190

                  1. Initial program 67.4%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y around 0

                    \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                    3. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                    4. +-lowering-+.f6479.6%

                      \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                  5. Simplified79.6%

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

                  if 3.2000000000000001e-190 < y

                  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. Add Preprocessing
                  3. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                    3. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                    4. +-lowering-+.f6453.5%

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                  5. Simplified53.5%

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

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

                      \[\leadsto \frac{\frac{x}{y + 1}}{\color{blue}{y}} \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y + 1}\right), \color{blue}{y}\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), y\right) \]
                    5. +-lowering-+.f6457.5%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), y\right) \]
                  7. Applied egg-rr57.5%

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

                Alternative 12: 99.8% accurate, 1.0× speedup?

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

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. associate-/r*N/A

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

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

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

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

                    \[\leadsto \frac{x \cdot \frac{y}{x + y}}{\left(\left(x + y\right) + 1\right) \cdot \color{blue}{\left(x + y\right)}} \]
                  6. times-fracN/A

                    \[\leadsto \frac{x}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\left(\frac{x}{\left(x + y\right) + 1}\right), \color{blue}{\left(\frac{\frac{y}{x + y}}{x + y}\right)}\right) \]
                  8. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(\left(x + y\right) + 1\right)\right), \left(\frac{\color{blue}{\frac{y}{x + y}}}{x + y}\right)\right) \]
                  9. associate-+r+N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \left(x + \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(\frac{\frac{y}{\color{blue}{x + y}}}{x + y}\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(\frac{\frac{y}{x + \color{blue}{y}}}{x + y}\right)\right) \]
                  12. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + y\right)}\right)\right) \]
                  13. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + y\right)\right)\right) \]
                  14. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + y\right)\right)\right) \]
                  15. +-lowering-+.f6499.7%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
                4. Applied egg-rr99.7%

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

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

                Alternative 13: 81.4% accurate, 1.1× speedup?

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

                  1. Initial program 56.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. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                    6. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                    7. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    9. associate-/l*N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    11. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    13. associate-+r+N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    14. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    15. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                    16. +-lowering-+.f6499.8%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                  4. Applied egg-rr99.8%

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

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                  6. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    3. +-lowering-+.f6461.4%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                  7. Simplified61.4%

                    \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]
                  8. Step-by-step derivation
                    1. associate-/l/N/A

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

                      \[\leadsto \frac{\frac{y}{x + y}}{\color{blue}{x + 1}} \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + 1\right)}\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + 1\right)\right) \]
                    5. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + 1\right)\right) \]
                    6. +-lowering-+.f6461.4%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
                  9. Applied egg-rr61.4%

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

                  if 3.2000000000000001e-190 < y

                  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. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                    6. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                    7. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    9. associate-/l*N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    11. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    13. associate-+r+N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    14. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    15. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                    16. +-lowering-+.f6499.9%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                  4. Applied egg-rr99.9%

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{x}, \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                  6. Step-by-step derivation
                    1. Simplified58.6%

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

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

                  Alternative 14: 64.9% accurate, 1.1× speedup?

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

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

                      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6456.2%

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified56.2%

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

                      \[\leadsto \color{blue}{\frac{y}{x}} \]
                    7. Step-by-step derivation
                      1. /-lowering-/.f6436.3%

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{x}\right) \]
                    8. Simplified36.3%

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

                    if 3.2000000000000001e-190 < y < 1

                    1. Initial program 84.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. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6436.2%

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified36.2%

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

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

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
                    8. Simplified34.9%

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

                    if 1 < y

                    1. Initial program 63.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. Taylor expanded in y around inf

                      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left({y}^{2}\right)}\right) \]
                      2. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \left(y \cdot \color{blue}{y}\right)\right) \]
                      3. *-lowering-*.f6467.1%

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{y}\right)\right) \]
                    5. Simplified67.1%

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

                  Alternative 15: 81.2% accurate, 1.2× speedup?

                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{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 3.2e-190) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
                  assert(x < y);
                  double code(double x, double y) {
                  	double tmp;
                  	if (y <= 3.2e-190) {
                  		tmp = (y / (y + x)) / (x + 1.0);
                  	} else {
                  		tmp = (x / (y + 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 <= 3.2d-190) then
                          tmp = (y / (y + x)) / (x + 1.0d0)
                      else
                          tmp = (x / (y + 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 <= 3.2e-190) {
                  		tmp = (y / (y + x)) / (x + 1.0);
                  	} else {
                  		tmp = (x / (y + 1.0)) / (y + x);
                  	}
                  	return tmp;
                  }
                  
                  [x, y] = sort([x, y])
                  def code(x, y):
                  	tmp = 0
                  	if y <= 3.2e-190:
                  		tmp = (y / (y + x)) / (x + 1.0)
                  	else:
                  		tmp = (x / (y + 1.0)) / (y + x)
                  	return tmp
                  
                  x, y = sort([x, y])
                  function code(x, y)
                  	tmp = 0.0
                  	if (y <= 3.2e-190)
                  		tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + 1.0));
                  	else
                  		tmp = Float64(Float64(x / Float64(y + 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 <= 3.2e-190)
                  		tmp = (y / (y + x)) / (x + 1.0);
                  	else
                  		tmp = (x / (y + 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, 3.2e-190], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  [x, y] = \mathsf{sort}([x, y])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
                  \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y < 3.2000000000000001e-190

                    1. Initial program 56.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. associate-/r*N/A

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      9. associate-/l*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      13. associate-+r+N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      14. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      15. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                      16. +-lowering-+.f6499.8%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                    4. Applied egg-rr99.8%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                    6. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                      3. +-lowering-+.f6461.4%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    7. Simplified61.4%

                      \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]
                    8. Step-by-step derivation
                      1. associate-/l/N/A

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

                        \[\leadsto \frac{\frac{y}{x + y}}{\color{blue}{x + 1}} \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x + y}\right), \color{blue}{\left(x + 1\right)}\right) \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + y\right)\right), \left(\color{blue}{x} + 1\right)\right) \]
                      5. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \left(x + 1\right)\right) \]
                      6. +-lowering-+.f6461.4%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, y\right)\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
                    9. Applied egg-rr61.4%

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

                    if 3.2000000000000001e-190 < y

                    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. Add Preprocessing
                    3. Step-by-step derivation
                      1. associate-/r*N/A

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      9. associate-/l*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      13. associate-+r+N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      14. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      15. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                      16. +-lowering-+.f6499.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                    4. Applied egg-rr99.9%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{1 + y}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                    6. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(1 + y\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                      3. +-lowering-+.f6457.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    7. Simplified57.9%

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

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

                  Alternative 16: 81.2% accurate, 1.2× speedup?

                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{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 3.2e-190) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
                  assert(x < y);
                  double code(double x, double y) {
                  	double tmp;
                  	if (y <= 3.2e-190) {
                  		tmp = (y / (x + 1.0)) / (y + x);
                  	} else {
                  		tmp = (x / (y + 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 <= 3.2d-190) then
                          tmp = (y / (x + 1.0d0)) / (y + x)
                      else
                          tmp = (x / (y + 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 <= 3.2e-190) {
                  		tmp = (y / (x + 1.0)) / (y + x);
                  	} else {
                  		tmp = (x / (y + 1.0)) / (y + x);
                  	}
                  	return tmp;
                  }
                  
                  [x, y] = sort([x, y])
                  def code(x, y):
                  	tmp = 0
                  	if y <= 3.2e-190:
                  		tmp = (y / (x + 1.0)) / (y + x)
                  	else:
                  		tmp = (x / (y + 1.0)) / (y + x)
                  	return tmp
                  
                  x, y = sort([x, y])
                  function code(x, y)
                  	tmp = 0.0
                  	if (y <= 3.2e-190)
                  		tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x));
                  	else
                  		tmp = Float64(Float64(x / Float64(y + 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 <= 3.2e-190)
                  		tmp = (y / (x + 1.0)) / (y + x);
                  	else
                  		tmp = (x / (y + 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, 3.2e-190], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  [x, y] = \mathsf{sort}([x, y])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
                  \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y < 3.2000000000000001e-190

                    1. Initial program 56.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. associate-/r*N/A

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      9. associate-/l*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      13. associate-+r+N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      14. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      15. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                      16. +-lowering-+.f6499.8%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                    4. Applied egg-rr99.8%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                    6. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                      3. +-lowering-+.f6461.4%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    7. Simplified61.4%

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

                    if 3.2000000000000001e-190 < y

                    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. Add Preprocessing
                    3. Step-by-step derivation
                      1. associate-/r*N/A

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      9. associate-/l*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      13. associate-+r+N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      14. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      15. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                      16. +-lowering-+.f6499.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                    4. Applied egg-rr99.9%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{1 + y}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                    6. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(1 + y\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                      3. +-lowering-+.f6457.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    7. Simplified57.9%

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

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

                  Alternative 17: 81.2% accurate, 1.2× speedup?

                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{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 3.2e-190) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
                  assert(x < y);
                  double code(double x, double y) {
                  	double tmp;
                  	if (y <= 3.2e-190) {
                  		tmp = (y / x) / (x + 1.0);
                  	} else {
                  		tmp = (x / (y + 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 <= 3.2d-190) then
                          tmp = (y / x) / (x + 1.0d0)
                      else
                          tmp = (x / (y + 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 <= 3.2e-190) {
                  		tmp = (y / x) / (x + 1.0);
                  	} else {
                  		tmp = (x / (y + 1.0)) / (y + x);
                  	}
                  	return tmp;
                  }
                  
                  [x, y] = sort([x, y])
                  def code(x, y):
                  	tmp = 0
                  	if y <= 3.2e-190:
                  		tmp = (y / x) / (x + 1.0)
                  	else:
                  		tmp = (x / (y + 1.0)) / (y + x)
                  	return tmp
                  
                  x, y = sort([x, y])
                  function code(x, y)
                  	tmp = 0.0
                  	if (y <= 3.2e-190)
                  		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
                  	else
                  		tmp = Float64(Float64(x / Float64(y + 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 <= 3.2e-190)
                  		tmp = (y / x) / (x + 1.0);
                  	else
                  		tmp = (x / (y + 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, 3.2e-190], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  [x, y] = \mathsf{sort}([x, y])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\
                  \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if y < 3.2000000000000001e-190

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

                      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6456.2%

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified56.2%

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

                        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
                      2. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{\left(x + 1\right)}\right) \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), \left(\color{blue}{x} + 1\right)\right) \]
                      4. +-lowering-+.f6460.8%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
                    7. Applied egg-rr60.8%

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

                    if 3.2000000000000001e-190 < y

                    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. Add Preprocessing
                    3. Step-by-step derivation
                      1. associate-/r*N/A

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      9. associate-/l*N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      11. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                      13. associate-+r+N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      14. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                      15. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                      16. +-lowering-+.f6499.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                    4. Applied egg-rr99.9%

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

                      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{x}{1 + y}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                    6. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(1 + y\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                      2. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                      3. +-lowering-+.f6457.9%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    7. Simplified57.9%

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

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

                  Alternative 18: 81.0% accurate, 1.4× speedup?

                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-190}:\\ \;\;\;\;\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 3.2e-190) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) y)))
                  assert(x < y);
                  double code(double x, double y) {
                  	double tmp;
                  	if (y <= 3.2e-190) {
                  		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 <= 3.2d-190) 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 <= 3.2e-190) {
                  		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 <= 3.2e-190:
                  		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 <= 3.2e-190)
                  		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 <= 3.2e-190)
                  		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, 3.2e-190], 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 3.2 \cdot 10^{-190}:\\
                  \;\;\;\;\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 < 3.2000000000000001e-190

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

                      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6456.2%

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified56.2%

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

                        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
                      2. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{y}{x}\right), \color{blue}{\left(x + 1\right)}\right) \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), \left(\color{blue}{x} + 1\right)\right) \]
                      4. +-lowering-+.f6460.8%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right) \]
                    7. Applied egg-rr60.8%

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

                    if 3.2000000000000001e-190 < y

                    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. Add Preprocessing
                    3. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6453.5%

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified53.5%

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

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

                        \[\leadsto \frac{\frac{x}{y + 1}}{\color{blue}{y}} \]
                      3. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\left(\frac{x}{y + 1}\right), \color{blue}{y}\right) \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \left(y + 1\right)\right), y\right) \]
                      5. +-lowering-+.f6457.5%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right), y\right) \]
                    7. Applied egg-rr57.5%

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

                  Alternative 19: 42.6% accurate, 2.1× speedup?

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

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

                      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(x \cdot \left(1 + x\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \color{blue}{\left(1 + x\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \left(x + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6454.1%

                        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified54.1%

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

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

                        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{x}\right) \]
                    8. Simplified34.9%

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

                    if -3.2e-236 < x

                    1. Initial program 61.3%

                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                    4. Step-by-step derivation
                      1. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                      4. +-lowering-+.f6445.9%

                        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                    5. Simplified45.9%

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

                      \[\leadsto \color{blue}{\frac{x}{y}} \]
                    7. Step-by-step derivation
                      1. /-lowering-/.f6430.3%

                        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
                    8. Simplified30.3%

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

                  Alternative 20: 26.1% 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 63.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. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                  4. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(y \cdot \left(1 + y\right)\right)}\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 + y\right)}\right)\right) \]
                    3. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \left(y + \color{blue}{1}\right)\right)\right) \]
                    4. +-lowering-+.f6444.3%

                      \[\leadsto \mathsf{/.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(y, \color{blue}{1}\right)\right)\right) \]
                  5. Simplified44.3%

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

                    \[\leadsto \color{blue}{\frac{x}{y}} \]
                  7. Step-by-step derivation
                    1. /-lowering-/.f6423.8%

                      \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{y}\right) \]
                  8. Simplified23.8%

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

                  Alternative 21: 4.0% 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 63.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. Taylor expanded in x around 0

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\color{blue}{\left({y}^{2}\right)}, \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, y\right), 1\right)\right)\right) \]
                  4. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\left(y \cdot y\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(x, y\right)}, 1\right)\right)\right) \]
                    2. *-lowering-*.f6429.6%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, y\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(y, y\right), \mathsf{+.f64}\left(\color{blue}{\mathsf{+.f64}\left(x, y\right)}, 1\right)\right)\right) \]
                  5. Simplified29.6%

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

                    \[\leadsto \color{blue}{\frac{1}{y}} \]
                  7. Step-by-step derivation
                    1. /-lowering-/.f644.2%

                      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{y}\right) \]
                  8. Simplified4.2%

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

                  Alternative 22: 3.4% accurate, 17.0× speedup?

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

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}}{\color{blue}{x + y}} \]
                    6. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{x \cdot y}{x + y}}{\left(x + y\right) + 1}\right), \color{blue}{\left(x + y\right)}\right) \]
                    7. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{x \cdot y}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(\color{blue}{x} + y\right)\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{y \cdot x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    9. associate-/l*N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(y \cdot \frac{x}{x + y}\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \left(\frac{x}{x + y}\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    11. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \left(x + y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(\left(x + y\right) + 1\right)\right), \left(x + y\right)\right) \]
                    13. associate-+r+N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \left(x + \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    14. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \left(y + 1\right)\right)\right), \left(x + y\right)\right) \]
                    15. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \left(x + y\right)\right) \]
                    16. +-lowering-+.f6499.8%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(y, \mathsf{/.f64}\left(x, \mathsf{+.f64}\left(x, y\right)\right)\right), \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(y, 1\right)\right)\right), \mathsf{+.f64}\left(x, \color{blue}{y}\right)\right) \]
                  4. Applied egg-rr99.8%

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

                    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{y}{1 + x}\right)}, \mathsf{+.f64}\left(x, y\right)\right) \]
                  6. Step-by-step derivation
                    1. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(1 + x\right)\right), \mathsf{+.f64}\left(\color{blue}{x}, y\right)\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \left(x + 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                    3. +-lowering-+.f6454.0%

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(y, \mathsf{+.f64}\left(x, 1\right)\right), \mathsf{+.f64}\left(x, y\right)\right) \]
                  7. Simplified54.0%

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

                    \[\leadsto \color{blue}{1} \]
                  9. Step-by-step derivation
                    1. Simplified3.6%

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

                    Developer Target 1: 99.8% accurate, 0.9× speedup?

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

                    Reproduce

                    ?
                    herbie shell --seed 2024152 
                    (FPCore (x y)
                      :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
                      :precision binary64
                    
                      :alt
                      (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
                    
                      (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))