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

Percentage Accurate: 69.0% → 99.8%
Time: 8.5s
Alternatives: 14
Speedup: 1.6×

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 14 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.0% 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, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 68.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot y}{\color{blue}{\left(1 + \left(x + y\right)\right)} \cdot \left(x + y\right)} \]
      18. lower-+.f6496.2

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot y}{\left(1 + \color{blue}{\left(y + x\right)}\right) \cdot \left(x + y\right)} \]
      21. lower-+.f6496.2

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot y}{\left(1 + \left(y + x\right)\right) \cdot \color{blue}{\left(y + x\right)}} \]
      24. lower-+.f6496.2

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

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

    if 1.02e138 < y

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 62.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.6999999999999999e-172 < y < 1.75e71

      1. Initial program 92.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

      if 1.75e71 < y

      1. Initial program 56.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

    Alternative 4: 95.0% accurate, 0.8× speedup?

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

      1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.2500000000000001e96 < y

      1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

    Alternative 5: 95.0% accurate, 0.8× speedup?

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

      1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y}{\left(1 + \left(y + x\right)\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{x}{x + y} \]
        22. lower-/.f6496.4

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

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

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

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

      if 1.2500000000000001e96 < y

      1. Initial program 56.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

    Alternative 6: 91.3% accurate, 0.8× speedup?

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

      1. Initial program 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -4.60000000000000027e-11 < x

        1. Initial program 68.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. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{y}{\left(1 + \left(y + x\right)\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{x}{x + y} \]
          22. lower-/.f6495.8

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

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

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

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

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

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

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

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

      Alternative 7: 82.4% accurate, 0.9× speedup?

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

        1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.8999999999999998e-99 < y

          1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
            2. lower-+.f6479.5

              \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
          7. Applied rewrites79.5%

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

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

        Alternative 8: 80.8% accurate, 1.1× speedup?

        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\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 1.9e-99)
           (/ y (fma x x x))
           (if (<= y 2e+17) (/ x (fma y y y)) (/ (/ x y) y))))
        assert(x < y);
        double code(double x, double y) {
        	double tmp;
        	if (y <= 1.9e-99) {
        		tmp = y / fma(x, x, x);
        	} else if (y <= 2e+17) {
        		tmp = x / fma(y, y, y);
        	} else {
        		tmp = (x / y) / y;
        	}
        	return tmp;
        }
        
        x, y = sort([x, y])
        function code(x, y)
        	tmp = 0.0
        	if (y <= 1.9e-99)
        		tmp = Float64(y / fma(x, x, x));
        	elseif (y <= 2e+17)
        		tmp = Float64(x / fma(y, y, y));
        	else
        		tmp = Float64(Float64(x / y) / y);
        	end
        	return tmp
        end
        
        NOTE: x and y should be sorted in increasing order before calling this function.
        code[x_, y_] := If[LessEqual[y, 1.9e-99], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+17], N[(x / N[(y * y + y), $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 1.9 \cdot 10^{-99}:\\
        \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
        
        \mathbf{elif}\;y \leq 2 \cdot 10^{+17}:\\
        \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{x}{y}}{y}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < 1.8999999999999998e-99

          1. Initial program 66.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 y around 0

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

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

              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
            3. distribute-lft-inN/A

              \[\leadsto \frac{y}{\color{blue}{x \cdot x + x \cdot 1}} \]
            4. *-rgt-identityN/A

              \[\leadsto \frac{y}{x \cdot x + \color{blue}{x}} \]
            5. lower-fma.f6460.7

              \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(x, x, x\right)}} \]
          5. Applied rewrites60.7%

            \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(x, x, x\right)}} \]

          if 1.8999999999999998e-99 < y < 2e17

          1. Initial program 89.8%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. 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. lower-/.f64N/A

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

              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
            3. distribute-lft-inN/A

              \[\leadsto \frac{x}{\color{blue}{y \cdot y + y \cdot 1}} \]
            4. *-rgt-identityN/A

              \[\leadsto \frac{x}{y \cdot y + \color{blue}{y}} \]
            5. lower-fma.f6456.9

              \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(y, y, y\right)}} \]
          5. Applied rewrites56.9%

            \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(y, y, y\right)}} \]

          if 2e17 < y

          1. Initial program 59.0%

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

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

              \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
            2. unpow2N/A

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
            3. lower-*.f6479.3

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
          5. Applied rewrites79.3%

            \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
          6. Step-by-step derivation
            1. Applied rewrites85.2%

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

          Alternative 9: 82.4% accurate, 1.1× speedup?

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

            1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

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

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

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

            if 1.8999999999999998e-99 < y

            1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
              2. lower-+.f6479.5

                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
            7. Applied rewrites79.5%

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

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

          Alternative 10: 81.0% accurate, 1.1× speedup?

          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\ \end{array} \end{array} \]
          NOTE: x and y should be sorted in increasing order before calling this function.
          (FPCore (x y)
           :precision binary64
           (if (<= y 1.9e-99) (/ y (fma x x x)) (/ (/ x (+ 1.0 y)) (+ x y))))
          assert(x < y);
          double code(double x, double y) {
          	double tmp;
          	if (y <= 1.9e-99) {
          		tmp = y / fma(x, x, x);
          	} else {
          		tmp = (x / (1.0 + y)) / (x + y);
          	}
          	return tmp;
          }
          
          x, y = sort([x, y])
          function code(x, y)
          	tmp = 0.0
          	if (y <= 1.9e-99)
          		tmp = Float64(y / fma(x, x, x));
          	else
          		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(x + y));
          	end
          	return tmp
          end
          
          NOTE: x and y should be sorted in increasing order before calling this function.
          code[x_, y_] := If[LessEqual[y, 1.9e-99], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          [x, y] = \mathsf{sort}([x, y])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 1.9 \cdot 10^{-99}:\\
          \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\frac{x}{1 + y}}{x + y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < 1.8999999999999998e-99

            1. Initial program 66.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 y around 0

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

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

                \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
              3. distribute-lft-inN/A

                \[\leadsto \frac{y}{\color{blue}{x \cdot x + x \cdot 1}} \]
              4. *-rgt-identityN/A

                \[\leadsto \frac{y}{x \cdot x + \color{blue}{x}} \]
              5. lower-fma.f6460.7

                \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(x, x, x\right)}} \]
            5. Applied rewrites60.7%

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(x, x, x\right)}} \]

            if 1.8999999999999998e-99 < y

            1. Initial program 65.5%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
              2. lower-+.f6479.5

                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
            7. Applied rewrites79.5%

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

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

          Alternative 11: 78.8% accurate, 1.6× speedup?

          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\ \end{array} \end{array} \]
          NOTE: x and y should be sorted in increasing order before calling this function.
          (FPCore (x y)
           :precision binary64
           (if (<= y 1.9e-99) (/ y (fma x x x)) (/ x (fma y y y))))
          assert(x < y);
          double code(double x, double y) {
          	double tmp;
          	if (y <= 1.9e-99) {
          		tmp = y / fma(x, x, x);
          	} else {
          		tmp = x / fma(y, y, y);
          	}
          	return tmp;
          }
          
          x, y = sort([x, y])
          function code(x, y)
          	tmp = 0.0
          	if (y <= 1.9e-99)
          		tmp = Float64(y / fma(x, x, x));
          	else
          		tmp = Float64(x / fma(y, y, y));
          	end
          	return tmp
          end
          
          NOTE: x and y should be sorted in increasing order before calling this function.
          code[x_, y_] := If[LessEqual[y, 1.9e-99], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          [x, y] = \mathsf{sort}([x, y])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 1.9 \cdot 10^{-99}:\\
          \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < 1.8999999999999998e-99

            1. Initial program 66.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 y around 0

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

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

                \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
              3. distribute-lft-inN/A

                \[\leadsto \frac{y}{\color{blue}{x \cdot x + x \cdot 1}} \]
              4. *-rgt-identityN/A

                \[\leadsto \frac{y}{x \cdot x + \color{blue}{x}} \]
              5. lower-fma.f6460.7

                \[\leadsto \frac{y}{\color{blue}{\mathsf{fma}\left(x, x, x\right)}} \]
            5. Applied rewrites60.7%

              \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(x, x, x\right)}} \]

            if 1.8999999999999998e-99 < y

            1. Initial program 65.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. lower-/.f64N/A

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

                \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
              3. distribute-lft-inN/A

                \[\leadsto \frac{x}{\color{blue}{y \cdot y + y \cdot 1}} \]
              4. *-rgt-identityN/A

                \[\leadsto \frac{x}{y \cdot y + \color{blue}{y}} \]
              5. lower-fma.f6474.6

                \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(y, y, y\right)}} \]
            5. Applied rewrites74.6%

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

          Alternative 12: 73.5% accurate, 1.6× speedup?

          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+64}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\ \end{array} \end{array} \]
          NOTE: x and y should be sorted in increasing order before calling this function.
          (FPCore (x y)
           :precision binary64
           (if (<= x -2.1e+64) (/ y (* x x)) (/ x (fma y y y))))
          assert(x < y);
          double code(double x, double y) {
          	double tmp;
          	if (x <= -2.1e+64) {
          		tmp = y / (x * x);
          	} else {
          		tmp = x / fma(y, y, y);
          	}
          	return tmp;
          }
          
          x, y = sort([x, y])
          function code(x, y)
          	tmp = 0.0
          	if (x <= -2.1e+64)
          		tmp = Float64(y / Float64(x * x));
          	else
          		tmp = Float64(x / fma(y, y, y));
          	end
          	return tmp
          end
          
          NOTE: x and y should be sorted in increasing order before calling this function.
          code[x_, y_] := If[LessEqual[x, -2.1e+64], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          [x, y] = \mathsf{sort}([x, y])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -2.1 \cdot 10^{+64}:\\
          \;\;\;\;\frac{y}{x \cdot x}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -2.1e64

            1. Initial program 55.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 \color{blue}{\frac{y}{{x}^{2}}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
              3. lower-*.f6485.3

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
            5. Applied rewrites85.3%

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

            if -2.1e64 < x

            1. Initial program 68.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. lower-/.f64N/A

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

                \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
              3. distribute-lft-inN/A

                \[\leadsto \frac{x}{\color{blue}{y \cdot y + y \cdot 1}} \]
              4. *-rgt-identityN/A

                \[\leadsto \frac{x}{y \cdot y + \color{blue}{y}} \]
              5. lower-fma.f6459.9

                \[\leadsto \frac{x}{\color{blue}{\mathsf{fma}\left(y, y, y\right)}} \]
            5. Applied rewrites59.9%

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

          Alternative 13: 64.3% accurate, 1.7× speedup?

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

            1. Initial program 68.1%

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

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

                \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
              3. lower-*.f6445.5

                \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
            5. Applied rewrites45.5%

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

            if 1.62e7 < y

            1. Initial program 59.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 y around inf

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

                \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
              3. lower-*.f6479.4

                \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
            5. Applied rewrites79.4%

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

          Alternative 14: 37.2% accurate, 2.3× speedup?

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

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

              \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
            2. unpow2N/A

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
            3. lower-*.f6438.8

              \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
          5. Applied rewrites38.8%

            \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
          6. Add Preprocessing

          Developer Target 1: 99.8% accurate, 0.6× 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 2024332 
          (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))))