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

Percentage Accurate: 68.7% → 99.8%
Time: 14.4s
Alternatives: 16
Speedup: 1.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 68.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.3% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.50000000000000001e-280 < y < 5.1000000000000003e-17

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.1000000000000003e-17 < y

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.5% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6000000000000003e-176 < y < 13

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 13 < y

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 93.3% accurate, 0.9× speedup?

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e-15 < x

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 96.5% accurate, 0.9× speedup?

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

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


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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

    if 1.4e154 < y

    1. Initial program 44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{y} \]
      2. div-inv85.9%

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

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

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

Alternative 6: 93.1% accurate, 1.0× speedup?

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e-15 < x

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 86.5% accurate, 1.1× speedup?

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

\mathbf{elif}\;x \leq -1.6 \cdot 10^{-279}:\\
\;\;\;\;t_1 \cdot t_0\\

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x + 1}} \]
    7. Step-by-step derivation
      1. un-div-inv76.3%

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

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

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

    if -1.45000000000000009e-15 < x < -1.5999999999999999e-279

    1. Initial program 78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e-279 < x

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-15}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{x + 1}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-279}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{x}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y + 1}\\ \end{array} \]

Alternative 8: 80.5% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.65e-102 < y < 1.24999999999999991e74

    1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999991e74 < y

    1. Initial program 47.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 80.8% accurate, 1.5× speedup?

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.15e-117 < y

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 82.1% accurate, 1.5× speedup?

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x + 1}} \]
    7. Step-by-step derivation
      1. un-div-inv57.3%

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

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

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

    if 3.3e-102 < y

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 48.4% accurate, 1.9× speedup?

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

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


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

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.76000000000000001 < y

    1. Initial program 56.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 50.3% accurate, 1.9× speedup?

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

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


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

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000046e55 < y

    1. Initial program 49.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 80.5% accurate, 1.9× speedup?

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.35e-102 < y

    1. Initial program 60.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 27.4% accurate, 2.4× speedup?

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

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


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

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.49999999999999995e-6 < x

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 4.1% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{y} \]

Alternative 16: 25.8% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{x}{\color{blue}{y}} \]
  8. Final simplification27.5%

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

Developer target: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

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

  :herbie-target
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

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