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

Percentage Accurate: 70.1% → 99.8%
Time: 13.5s
Alternatives: 24
Speedup: 1.0×

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 24 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: 70.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\frac{\frac{x}{x + y}}{x + y} \cdot \frac{y}{x + \left(y + 1\right)}
\end{array}
Derivation
  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. times-frac85.6%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 64.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ t_1 := y \cdot \frac{t_0}{x + y}\\ t_2 := \frac{t_0}{y + 1}\\ \mathbf{if}\;x \leq -1.9 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x}\\ \mathbf{elif}\;x \leq -1.28 \cdot 10^{-23}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-252}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y)))
        (t_1 (* y (/ t_0 (+ x y))))
        (t_2 (/ t_0 (+ y 1.0))))
   (if (<= x -1.9e+15)
     (/ (/ y (+ x y)) x)
     (if (<= x -1.28e-23)
       t_2
       (if (<= x -1.4e-70)
         t_1
         (if (<= x -4.2e-76) (/ x (* y y)) (if (<= x -1.5e-252) t_1 t_2)))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = y * (t_0 / (x + y));
	double t_2 = t_0 / (y + 1.0);
	double tmp;
	if (x <= -1.9e+15) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.28e-23) {
		tmp = t_2;
	} else if (x <= -1.4e-70) {
		tmp = t_1;
	} else if (x <= -4.2e-76) {
		tmp = x / (y * y);
	} else if (x <= -1.5e-252) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
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) :: t_2
    real(8) :: tmp
    t_0 = x / (x + y)
    t_1 = y * (t_0 / (x + y))
    t_2 = t_0 / (y + 1.0d0)
    if (x <= (-1.9d+15)) then
        tmp = (y / (x + y)) / x
    else if (x <= (-1.28d-23)) then
        tmp = t_2
    else if (x <= (-1.4d-70)) then
        tmp = t_1
    else if (x <= (-4.2d-76)) then
        tmp = x / (y * y)
    else if (x <= (-1.5d-252)) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = y * (t_0 / (x + y));
	double t_2 = t_0 / (y + 1.0);
	double tmp;
	if (x <= -1.9e+15) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.28e-23) {
		tmp = t_2;
	} else if (x <= -1.4e-70) {
		tmp = t_1;
	} else if (x <= -4.2e-76) {
		tmp = x / (y * y);
	} else if (x <= -1.5e-252) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	t_1 = y * (t_0 / (x + y))
	t_2 = t_0 / (y + 1.0)
	tmp = 0
	if x <= -1.9e+15:
		tmp = (y / (x + y)) / x
	elif x <= -1.28e-23:
		tmp = t_2
	elif x <= -1.4e-70:
		tmp = t_1
	elif x <= -4.2e-76:
		tmp = x / (y * y)
	elif x <= -1.5e-252:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	t_1 = Float64(y * Float64(t_0 / Float64(x + y)))
	t_2 = Float64(t_0 / Float64(y + 1.0))
	tmp = 0.0
	if (x <= -1.9e+15)
		tmp = Float64(Float64(y / Float64(x + y)) / x);
	elseif (x <= -1.28e-23)
		tmp = t_2;
	elseif (x <= -1.4e-70)
		tmp = t_1;
	elseif (x <= -4.2e-76)
		tmp = Float64(x / Float64(y * y));
	elseif (x <= -1.5e-252)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	t_1 = y * (t_0 / (x + y));
	t_2 = t_0 / (y + 1.0);
	tmp = 0.0;
	if (x <= -1.9e+15)
		tmp = (y / (x + y)) / x;
	elseif (x <= -1.28e-23)
		tmp = t_2;
	elseif (x <= -1.4e-70)
		tmp = t_1;
	elseif (x <= -4.2e-76)
		tmp = x / (y * y);
	elseif (x <= -1.5e-252)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.9e+15], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.28e-23], t$95$2, If[LessEqual[x, -1.4e-70], t$95$1, If[LessEqual[x, -4.2e-76], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-252], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := y \cdot \frac{t_0}{x + y}\\
t_2 := \frac{t_0}{y + 1}\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x}\\

\mathbf{elif}\;x \leq -1.28 \cdot 10^{-23}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -1.4 \cdot 10^{-70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -4.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-252}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9e15 < x < -1.28000000000000005e-23 or -1.49999999999999997e-252 < x

    1. Initial program 65.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.28000000000000005e-23 < x < -1.4e-70 or -4.19999999999999985e-76 < x < -1.49999999999999997e-252

    1. Initial program 79.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e-70 < x < -4.19999999999999985e-76

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    10. Simplified75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x}\\ \mathbf{elif}\;x \leq -1.28 \cdot 10^{-23}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \mathbf{elif}\;x \leq -1.4 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-252}:\\ \;\;\;\;y \cdot \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \]

Alternative 3: 64.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ t_1 := \frac{t_0}{y + 1}\\ t_2 := y \cdot \frac{t_0}{x + y}\\ \mathbf{if}\;x \leq -8.4 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-22}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-70}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -5.1 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-253}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y)))
        (t_1 (/ t_0 (+ y 1.0)))
        (t_2 (* y (/ t_0 (+ x y)))))
   (if (<= x -8.4e+15)
     (/ (/ y (+ x (+ y 1.0))) (+ x y))
     (if (<= x -1.6e-22)
       t_1
       (if (<= x -8e-70)
         t_2
         (if (<= x -5.1e-76) (/ x (* y y)) (if (<= x -3.3e-253) t_2 t_1)))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (y + 1.0);
	double t_2 = y * (t_0 / (x + y));
	double tmp;
	if (x <= -8.4e+15) {
		tmp = (y / (x + (y + 1.0))) / (x + y);
	} else if (x <= -1.6e-22) {
		tmp = t_1;
	} else if (x <= -8e-70) {
		tmp = t_2;
	} else if (x <= -5.1e-76) {
		tmp = x / (y * y);
	} else if (x <= -3.3e-253) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
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) :: t_2
    real(8) :: tmp
    t_0 = x / (x + y)
    t_1 = t_0 / (y + 1.0d0)
    t_2 = y * (t_0 / (x + y))
    if (x <= (-8.4d+15)) then
        tmp = (y / (x + (y + 1.0d0))) / (x + y)
    else if (x <= (-1.6d-22)) then
        tmp = t_1
    else if (x <= (-8d-70)) then
        tmp = t_2
    else if (x <= (-5.1d-76)) then
        tmp = x / (y * y)
    else if (x <= (-3.3d-253)) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (y + 1.0);
	double t_2 = y * (t_0 / (x + y));
	double tmp;
	if (x <= -8.4e+15) {
		tmp = (y / (x + (y + 1.0))) / (x + y);
	} else if (x <= -1.6e-22) {
		tmp = t_1;
	} else if (x <= -8e-70) {
		tmp = t_2;
	} else if (x <= -5.1e-76) {
		tmp = x / (y * y);
	} else if (x <= -3.3e-253) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	t_1 = t_0 / (y + 1.0)
	t_2 = y * (t_0 / (x + y))
	tmp = 0
	if x <= -8.4e+15:
		tmp = (y / (x + (y + 1.0))) / (x + y)
	elif x <= -1.6e-22:
		tmp = t_1
	elif x <= -8e-70:
		tmp = t_2
	elif x <= -5.1e-76:
		tmp = x / (y * y)
	elif x <= -3.3e-253:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	t_1 = Float64(t_0 / Float64(y + 1.0))
	t_2 = Float64(y * Float64(t_0 / Float64(x + y)))
	tmp = 0.0
	if (x <= -8.4e+15)
		tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(x + y));
	elseif (x <= -1.6e-22)
		tmp = t_1;
	elseif (x <= -8e-70)
		tmp = t_2;
	elseif (x <= -5.1e-76)
		tmp = Float64(x / Float64(y * y));
	elseif (x <= -3.3e-253)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	t_1 = t_0 / (y + 1.0);
	t_2 = y * (t_0 / (x + y));
	tmp = 0.0;
	if (x <= -8.4e+15)
		tmp = (y / (x + (y + 1.0))) / (x + y);
	elseif (x <= -1.6e-22)
		tmp = t_1;
	elseif (x <= -8e-70)
		tmp = t_2;
	elseif (x <= -5.1e-76)
		tmp = x / (y * y);
	elseif (x <= -3.3e-253)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.4e+15], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.6e-22], t$95$1, If[LessEqual[x, -8e-70], t$95$2, If[LessEqual[x, -5.1e-76], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-253], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := \frac{t_0}{y + 1}\\
t_2 := y \cdot \frac{t_0}{x + y}\\
\mathbf{if}\;x \leq -8.4 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\

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

\mathbf{elif}\;x \leq -8 \cdot 10^{-70}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq -3.3 \cdot 10^{-253}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4e15 < x < -1.59999999999999994e-22 or -3.3000000000000001e-253 < x

    1. Initial program 65.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.59999999999999994e-22 < x < -7.99999999999999997e-70 or -5.09999999999999986e-76 < x < -3.3000000000000001e-253

    1. Initial program 79.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.99999999999999997e-70 < x < -5.09999999999999986e-76

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    10. Simplified75.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-22}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{elif}\;x \leq -5.1 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-253}:\\ \;\;\;\;y \cdot \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \]

Alternative 4: 85.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{if}\;x \leq -5 \cdot 10^{+165}:\\ \;\;\;\;t_0 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-20}:\\ \;\;\;\;\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{y}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ x (+ x y)) (+ x y))))
   (if (<= x -5e+165)
     (* t_0 (/ y x))
     (if (<= x -5e-20)
       (* (/ y (+ x (+ y 1.0))) (/ x (* (+ x y) (+ x y))))
       (* t_0 (/ y (+ y 1.0)))))))
double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -5e+165) {
		tmp = t_0 * (y / x);
	} else if (x <= -5e-20) {
		tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x / (x + y)) / (x + y)
    if (x <= (-5d+165)) then
        tmp = t_0 * (y / x)
    else if (x <= (-5d-20)) then
        tmp = (y / (x + (y + 1.0d0))) * (x / ((x + y) * (x + y)))
    else
        tmp = t_0 * (y / (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -5e+165) {
		tmp = t_0 * (y / x);
	} else if (x <= -5e-20) {
		tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / (x + y)) / (x + y)
	tmp = 0
	if x <= -5e+165:
		tmp = t_0 * (y / x)
	elif x <= -5e-20:
		tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)))
	else:
		tmp = t_0 * (y / (y + 1.0))
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / Float64(x + y)) / Float64(x + y))
	tmp = 0.0
	if (x <= -5e+165)
		tmp = Float64(t_0 * Float64(y / x));
	elseif (x <= -5e-20)
		tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) * Float64(x / Float64(Float64(x + y) * Float64(x + y))));
	else
		tmp = Float64(t_0 * Float64(y / Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / (x + y)) / (x + y);
	tmp = 0.0;
	if (x <= -5e+165)
		tmp = t_0 * (y / x);
	elseif (x <= -5e-20)
		tmp = (y / (x + (y + 1.0))) * (x / ((x + y) * (x + y)));
	else
		tmp = t_0 * (y / (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+165], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-20], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{x}{x + y}}{x + y}\\
\mathbf{if}\;x \leq -5 \cdot 10^{+165}:\\
\;\;\;\;t_0 \cdot \frac{y}{x}\\

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

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


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

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac78.9%

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e165 < x < -4.9999999999999999e-20

    1. Initial program 70.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac91.9%

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

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

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

    if -4.9999999999999999e-20 < x

    1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{if}\;x \leq -5 \cdot 10^{+165}:\\ \;\;\;\;t_0 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-45}:\\ \;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{y}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ x (+ x y)) (+ x y))))
   (if (<= x -5e+165)
     (* t_0 (/ y x))
     (if (<= x -2e-45)
       (* (/ y (* (+ x y) (+ x y))) (/ x (+ x (+ y 1.0))))
       (* t_0 (/ y (+ y 1.0)))))))
double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -5e+165) {
		tmp = t_0 * (y / x);
	} else if (x <= -2e-45) {
		tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x / (x + y)) / (x + y)
    if (x <= (-5d+165)) then
        tmp = t_0 * (y / x)
    else if (x <= (-2d-45)) then
        tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0d0)))
    else
        tmp = t_0 * (y / (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -5e+165) {
		tmp = t_0 * (y / x);
	} else if (x <= -2e-45) {
		tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / (x + y)) / (x + y)
	tmp = 0
	if x <= -5e+165:
		tmp = t_0 * (y / x)
	elif x <= -2e-45:
		tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)))
	else:
		tmp = t_0 * (y / (y + 1.0))
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / Float64(x + y)) / Float64(x + y))
	tmp = 0.0
	if (x <= -5e+165)
		tmp = Float64(t_0 * Float64(y / x));
	elseif (x <= -2e-45)
		tmp = Float64(Float64(y / Float64(Float64(x + y) * Float64(x + y))) * Float64(x / Float64(x + Float64(y + 1.0))));
	else
		tmp = Float64(t_0 * Float64(y / Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / (x + y)) / (x + y);
	tmp = 0.0;
	if (x <= -5e+165)
		tmp = t_0 * (y / x);
	elseif (x <= -2e-45)
		tmp = (y / ((x + y) * (x + y))) * (x / (x + (y + 1.0)));
	else
		tmp = t_0 * (y / (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+165], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2e-45], N[(N[(y / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{x}{x + y}}{x + y}\\
\mathbf{if}\;x \leq -5 \cdot 10^{+165}:\\
\;\;\;\;t_0 \cdot \frac{y}{x}\\

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

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


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

    1. Initial program 59.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac78.9%

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e165 < x < -1.99999999999999997e-45

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999997e-45 < x

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 70.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ t_1 := \frac{t_0}{x + y}\\ \mathbf{if}\;x \leq -85000000000000:\\ \;\;\;\;t_1 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{-161}:\\ \;\;\;\;\frac{y}{y + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-253}:\\ \;\;\;\;y \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + \left(x - \left(-1 - x\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y))) (t_1 (/ t_0 (+ x y))))
   (if (<= x -85000000000000.0)
     (* t_1 (/ y x))
     (if (<= x -6.5e-161)
       (* (/ y (+ y 1.0)) (/ x (* (+ x y) (+ x y))))
       (if (<= x -5.5e-253) (* y t_1) (/ t_0 (+ y (- x (- -1.0 x)))))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -85000000000000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -6.5e-161) {
		tmp = (y / (y + 1.0)) * (x / ((x + y) * (x + y)));
	} else if (x <= -5.5e-253) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + (x - (-1.0 - x)));
	}
	return tmp;
}
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 / (x + y)
    t_1 = t_0 / (x + y)
    if (x <= (-85000000000000.0d0)) then
        tmp = t_1 * (y / x)
    else if (x <= (-6.5d-161)) then
        tmp = (y / (y + 1.0d0)) * (x / ((x + y) * (x + y)))
    else if (x <= (-5.5d-253)) then
        tmp = y * t_1
    else
        tmp = t_0 / (y + (x - ((-1.0d0) - x)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -85000000000000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -6.5e-161) {
		tmp = (y / (y + 1.0)) * (x / ((x + y) * (x + y)));
	} else if (x <= -5.5e-253) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + (x - (-1.0 - x)));
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	t_1 = t_0 / (x + y)
	tmp = 0
	if x <= -85000000000000.0:
		tmp = t_1 * (y / x)
	elif x <= -6.5e-161:
		tmp = (y / (y + 1.0)) * (x / ((x + y) * (x + y)))
	elif x <= -5.5e-253:
		tmp = y * t_1
	else:
		tmp = t_0 / (y + (x - (-1.0 - x)))
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	t_1 = Float64(t_0 / Float64(x + y))
	tmp = 0.0
	if (x <= -85000000000000.0)
		tmp = Float64(t_1 * Float64(y / x));
	elseif (x <= -6.5e-161)
		tmp = Float64(Float64(y / Float64(y + 1.0)) * Float64(x / Float64(Float64(x + y) * Float64(x + y))));
	elseif (x <= -5.5e-253)
		tmp = Float64(y * t_1);
	else
		tmp = Float64(t_0 / Float64(y + Float64(x - Float64(-1.0 - x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	t_1 = t_0 / (x + y);
	tmp = 0.0;
	if (x <= -85000000000000.0)
		tmp = t_1 * (y / x);
	elseif (x <= -6.5e-161)
		tmp = (y / (y + 1.0)) * (x / ((x + y) * (x + y)));
	elseif (x <= -5.5e-253)
		tmp = y * t_1;
	else
		tmp = t_0 / (y + (x - (-1.0 - x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -85000000000000.0], N[(t$95$1 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.5e-161], N[(N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.5e-253], N[(y * t$95$1), $MachinePrecision], N[(t$95$0 / N[(y + N[(x - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := \frac{t_0}{x + y}\\
\mathbf{if}\;x \leq -85000000000000:\\
\;\;\;\;t_1 \cdot \frac{y}{x}\\

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

\mathbf{elif}\;x \leq -5.5 \cdot 10^{-253}:\\
\;\;\;\;y \cdot t_1\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e13 < x < -6.50000000000000008e-161

    1. Initial program 84.5%

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

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

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

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

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

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

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

    if -6.50000000000000008e-161 < x < -5.49999999999999974e-253

    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. times-frac78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999974e-253 < x

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ \mathbf{if}\;x \leq -6.8 \cdot 10^{+174}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\ \mathbf{elif}\;x \leq -2500000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-258}:\\ \;\;\;\;y \cdot \frac{t_0}{x + y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y))))
   (if (<= x -6.8e+174)
     (/ (/ y (+ x (+ y 1.0))) (+ x y))
     (if (<= x -2500000.0)
       (* (/ y x) (/ x (* (+ x y) (+ x y))))
       (if (<= x -5e-258) (* y (/ t_0 (+ x y))) (/ t_0 (+ y 1.0)))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double tmp;
	if (x <= -6.8e+174) {
		tmp = (y / (x + (y + 1.0))) / (x + y);
	} else if (x <= -2500000.0) {
		tmp = (y / x) * (x / ((x + y) * (x + y)));
	} else if (x <= -5e-258) {
		tmp = y * (t_0 / (x + y));
	} else {
		tmp = t_0 / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / (x + y)
    if (x <= (-6.8d+174)) then
        tmp = (y / (x + (y + 1.0d0))) / (x + y)
    else if (x <= (-2500000.0d0)) then
        tmp = (y / x) * (x / ((x + y) * (x + y)))
    else if (x <= (-5d-258)) then
        tmp = y * (t_0 / (x + y))
    else
        tmp = t_0 / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double tmp;
	if (x <= -6.8e+174) {
		tmp = (y / (x + (y + 1.0))) / (x + y);
	} else if (x <= -2500000.0) {
		tmp = (y / x) * (x / ((x + y) * (x + y)));
	} else if (x <= -5e-258) {
		tmp = y * (t_0 / (x + y));
	} else {
		tmp = t_0 / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	tmp = 0
	if x <= -6.8e+174:
		tmp = (y / (x + (y + 1.0))) / (x + y)
	elif x <= -2500000.0:
		tmp = (y / x) * (x / ((x + y) * (x + y)))
	elif x <= -5e-258:
		tmp = y * (t_0 / (x + y))
	else:
		tmp = t_0 / (y + 1.0)
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	tmp = 0.0
	if (x <= -6.8e+174)
		tmp = Float64(Float64(y / Float64(x + Float64(y + 1.0))) / Float64(x + y));
	elseif (x <= -2500000.0)
		tmp = Float64(Float64(y / x) * Float64(x / Float64(Float64(x + y) * Float64(x + y))));
	elseif (x <= -5e-258)
		tmp = Float64(y * Float64(t_0 / Float64(x + y)));
	else
		tmp = Float64(t_0 / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	tmp = 0.0;
	if (x <= -6.8e+174)
		tmp = (y / (x + (y + 1.0))) / (x + y);
	elseif (x <= -2500000.0)
		tmp = (y / x) * (x / ((x + y) * (x + y)));
	elseif (x <= -5e-258)
		tmp = y * (t_0 / (x + y));
	else
		tmp = t_0 / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.8e+174], N[(N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2500000.0], N[(N[(y / x), $MachinePrecision] * N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5e-258], N[(y * N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+174}:\\
\;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{x + y}\\

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

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

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


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

    1. Initial program 62.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8000000000000002e174 < x < -2.5e6

    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. times-frac87.1%

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

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

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

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

    if -2.5e6 < x < -4.9999999999999999e-258

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-258 < x

    1. Initial program 65.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ t_1 := \frac{t_0}{x + y}\\ \mathbf{if}\;x \leq -2500000:\\ \;\;\;\;t_1 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-255}:\\ \;\;\;\;y \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + \left(x - \left(-1 - x\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y))) (t_1 (/ t_0 (+ x y))))
   (if (<= x -2500000.0)
     (* t_1 (/ y x))
     (if (<= x -1.45e-255) (* y t_1) (/ t_0 (+ y (- x (- -1.0 x))))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -2500000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -1.45e-255) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + (x - (-1.0 - x)));
	}
	return tmp;
}
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 / (x + y)
    t_1 = t_0 / (x + y)
    if (x <= (-2500000.0d0)) then
        tmp = t_1 * (y / x)
    else if (x <= (-1.45d-255)) then
        tmp = y * t_1
    else
        tmp = t_0 / (y + (x - ((-1.0d0) - x)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -2500000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -1.45e-255) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + (x - (-1.0 - x)));
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	t_1 = t_0 / (x + y)
	tmp = 0
	if x <= -2500000.0:
		tmp = t_1 * (y / x)
	elif x <= -1.45e-255:
		tmp = y * t_1
	else:
		tmp = t_0 / (y + (x - (-1.0 - x)))
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	t_1 = Float64(t_0 / Float64(x + y))
	tmp = 0.0
	if (x <= -2500000.0)
		tmp = Float64(t_1 * Float64(y / x));
	elseif (x <= -1.45e-255)
		tmp = Float64(y * t_1);
	else
		tmp = Float64(t_0 / Float64(y + Float64(x - Float64(-1.0 - x))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	t_1 = t_0 / (x + y);
	tmp = 0.0;
	if (x <= -2500000.0)
		tmp = t_1 * (y / x);
	elseif (x <= -1.45e-255)
		tmp = y * t_1;
	else
		tmp = t_0 / (y + (x - (-1.0 - x)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2500000.0], N[(t$95$1 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.45e-255], N[(y * t$95$1), $MachinePrecision], N[(t$95$0 / N[(y + N[(x - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := \frac{t_0}{x + y}\\
\mathbf{if}\;x \leq -2500000:\\
\;\;\;\;t_1 \cdot \frac{y}{x}\\

\mathbf{elif}\;x \leq -1.45 \cdot 10^{-255}:\\
\;\;\;\;y \cdot t_1\\

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.8%

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

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

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

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

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

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

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

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

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

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

    if -2.5e6 < x < -1.45000000000000003e-255

    1. Initial program 80.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000003e-255 < x

    1. Initial program 64.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 83.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{x}{x + y}}{x + y}\\ \mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\ \;\;\;\;t_0 \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \frac{y}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (/ x (+ x y)) (+ x y))))
   (if (<= x -3.6e+14) (* t_0 (/ y x)) (* t_0 (/ y (+ y 1.0))))))
double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -3.6e+14) {
		tmp = t_0 * (y / x);
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x / (x + y)) / (x + y)
    if (x <= (-3.6d+14)) then
        tmp = t_0 * (y / x)
    else
        tmp = t_0 * (y / (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / (x + y)) / (x + y);
	double tmp;
	if (x <= -3.6e+14) {
		tmp = t_0 * (y / x);
	} else {
		tmp = t_0 * (y / (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / (x + y)) / (x + y)
	tmp = 0
	if x <= -3.6e+14:
		tmp = t_0 * (y / x)
	else:
		tmp = t_0 * (y / (y + 1.0))
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / Float64(x + y)) / Float64(x + y))
	tmp = 0.0
	if (x <= -3.6e+14)
		tmp = Float64(t_0 * Float64(y / x));
	else
		tmp = Float64(t_0 * Float64(y / Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / (x + y)) / (x + y);
	tmp = 0.0;
	if (x <= -3.6e+14)
		tmp = t_0 * (y / x);
	else
		tmp = t_0 * (y / (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e+14], N[(t$95$0 * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(y / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{x}{x + y}}{x + y}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{+14}:\\
\;\;\;\;t_0 \cdot \frac{y}{x}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e14 < x

    1. Initial program 69.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 54.4% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-23}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-179}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -1.65e+14)
   (/ y (* x x))
   (if (<= x -7.5e-23)
     (/ x (* y y))
     (if (<= x -4e-137)
       (/ y x)
       (if (<= x 4.6e-179) (/ 1.0 (/ y x)) (/ 1.0 (* y (/ y x))))))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.65e+14) {
		tmp = y / (x * x);
	} else if (x <= -7.5e-23) {
		tmp = x / (y * y);
	} else if (x <= -4e-137) {
		tmp = y / x;
	} else if (x <= 4.6e-179) {
		tmp = 1.0 / (y / x);
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.65d+14)) then
        tmp = y / (x * x)
    else if (x <= (-7.5d-23)) then
        tmp = x / (y * y)
    else if (x <= (-4d-137)) then
        tmp = y / x
    else if (x <= 4.6d-179) then
        tmp = 1.0d0 / (y / x)
    else
        tmp = 1.0d0 / (y * (y / x))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.65e+14) {
		tmp = y / (x * x);
	} else if (x <= -7.5e-23) {
		tmp = x / (y * y);
	} else if (x <= -4e-137) {
		tmp = y / x;
	} else if (x <= 4.6e-179) {
		tmp = 1.0 / (y / x);
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.65e+14:
		tmp = y / (x * x)
	elif x <= -7.5e-23:
		tmp = x / (y * y)
	elif x <= -4e-137:
		tmp = y / x
	elif x <= 4.6e-179:
		tmp = 1.0 / (y / x)
	else:
		tmp = 1.0 / (y * (y / x))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.65e+14)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= -7.5e-23)
		tmp = Float64(x / Float64(y * y));
	elseif (x <= -4e-137)
		tmp = Float64(y / x);
	elseif (x <= 4.6e-179)
		tmp = Float64(1.0 / Float64(y / x));
	else
		tmp = Float64(1.0 / Float64(y * Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.65e+14)
		tmp = y / (x * x);
	elseif (x <= -7.5e-23)
		tmp = x / (y * y);
	elseif (x <= -4e-137)
		tmp = y / x;
	elseif (x <= 4.6e-179)
		tmp = 1.0 / (y / x);
	else
		tmp = 1.0 / (y * (y / x));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.65e+14], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-23], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4e-137], N[(y / x), $MachinePrecision], If[LessEqual[x, 4.6e-179], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -7.5 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq -4 \cdot 10^{-137}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;x \leq 4.6 \cdot 10^{-179}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

    if -1.65e14 < x < -7.4999999999999998e-23

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    10. Simplified90.7%

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

    if -7.4999999999999998e-23 < x < -3.99999999999999991e-137

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    if -3.99999999999999991e-137 < x < 4.59999999999999975e-179

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999975e-179 < x

    1. Initial program 68.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\color{blue}{y \cdot y}}{x}} \]
      2. associate-*l/37.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{y}{x} \cdot y}} \]
      3. *-commutative37.9%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \frac{y}{x}}} \]
    13. Simplified37.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.65 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-23}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-179}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\ \end{array} \]

Alternative 11: 67.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{x + y}\\ t_1 := \frac{t_0}{x + y}\\ \mathbf{if}\;x \leq -2500000:\\ \;\;\;\;t_1 \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -5.4 \cdot 10^{-252}:\\ \;\;\;\;y \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (+ x y))) (t_1 (/ t_0 (+ x y))))
   (if (<= x -2500000.0)
     (* t_1 (/ y x))
     (if (<= x -5.4e-252) (* y t_1) (/ t_0 (+ y 1.0))))))
double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -2500000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -5.4e-252) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + 1.0);
	}
	return tmp;
}
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 / (x + y)
    t_1 = t_0 / (x + y)
    if (x <= (-2500000.0d0)) then
        tmp = t_1 * (y / x)
    else if (x <= (-5.4d-252)) then
        tmp = y * t_1
    else
        tmp = t_0 / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (x + y);
	double t_1 = t_0 / (x + y);
	double tmp;
	if (x <= -2500000.0) {
		tmp = t_1 * (y / x);
	} else if (x <= -5.4e-252) {
		tmp = y * t_1;
	} else {
		tmp = t_0 / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (x + y)
	t_1 = t_0 / (x + y)
	tmp = 0
	if x <= -2500000.0:
		tmp = t_1 * (y / x)
	elif x <= -5.4e-252:
		tmp = y * t_1
	else:
		tmp = t_0 / (y + 1.0)
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(x + y))
	t_1 = Float64(t_0 / Float64(x + y))
	tmp = 0.0
	if (x <= -2500000.0)
		tmp = Float64(t_1 * Float64(y / x));
	elseif (x <= -5.4e-252)
		tmp = Float64(y * t_1);
	else
		tmp = Float64(t_0 / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (x + y);
	t_1 = t_0 / (x + y);
	tmp = 0.0;
	if (x <= -2500000.0)
		tmp = t_1 * (y / x);
	elseif (x <= -5.4e-252)
		tmp = y * t_1;
	else
		tmp = t_0 / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2500000.0], N[(t$95$1 * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -5.4e-252], N[(y * t$95$1), $MachinePrecision], N[(t$95$0 / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{x + y}\\
t_1 := \frac{t_0}{x + y}\\
\mathbf{if}\;x \leq -2500000:\\
\;\;\;\;t_1 \cdot \frac{y}{x}\\

\mathbf{elif}\;x \leq -5.4 \cdot 10^{-252}:\\
\;\;\;\;y \cdot t_1\\

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.8%

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

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

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

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

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

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

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

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

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

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

    if -2.5e6 < x < -5.39999999999999962e-252

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.39999999999999962e-252 < x

    1. Initial program 64.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 53.7% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y \cdot y}\\ \mathbf{if}\;x \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-188}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (* y y))))
   (if (<= x -1.05e+14)
     (/ y (* x x))
     (if (<= x -1.5e-26)
       t_0
       (if (<= x -2.1e-137) (/ y x) (if (<= x 2e-188) (/ 1.0 (/ y x)) t_0))))))
double code(double x, double y) {
	double t_0 = x / (y * y);
	double tmp;
	if (x <= -1.05e+14) {
		tmp = y / (x * x);
	} else if (x <= -1.5e-26) {
		tmp = t_0;
	} else if (x <= -2.1e-137) {
		tmp = y / x;
	} else if (x <= 2e-188) {
		tmp = 1.0 / (y / x);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / (y * y)
    if (x <= (-1.05d+14)) then
        tmp = y / (x * x)
    else if (x <= (-1.5d-26)) then
        tmp = t_0
    else if (x <= (-2.1d-137)) then
        tmp = y / x
    else if (x <= 2d-188) then
        tmp = 1.0d0 / (y / x)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / (y * y);
	double tmp;
	if (x <= -1.05e+14) {
		tmp = y / (x * x);
	} else if (x <= -1.5e-26) {
		tmp = t_0;
	} else if (x <= -2.1e-137) {
		tmp = y / x;
	} else if (x <= 2e-188) {
		tmp = 1.0 / (y / x);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = x / (y * y)
	tmp = 0
	if x <= -1.05e+14:
		tmp = y / (x * x)
	elif x <= -1.5e-26:
		tmp = t_0
	elif x <= -2.1e-137:
		tmp = y / x
	elif x <= 2e-188:
		tmp = 1.0 / (y / x)
	else:
		tmp = t_0
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(y * y))
	tmp = 0.0
	if (x <= -1.05e+14)
		tmp = Float64(y / Float64(x * x));
	elseif (x <= -1.5e-26)
		tmp = t_0;
	elseif (x <= -2.1e-137)
		tmp = Float64(y / x);
	elseif (x <= 2e-188)
		tmp = Float64(1.0 / Float64(y / x));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / (y * y);
	tmp = 0.0;
	if (x <= -1.05e+14)
		tmp = y / (x * x);
	elseif (x <= -1.5e-26)
		tmp = t_0;
	elseif (x <= -2.1e-137)
		tmp = y / x;
	elseif (x <= 2e-188)
		tmp = 1.0 / (y / x);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+14], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.5e-26], t$95$0, If[LessEqual[x, -2.1e-137], N[(y / x), $MachinePrecision], If[LessEqual[x, 2e-188], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+14}:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-137}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;x \leq 2 \cdot 10^{-188}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

    if -1.05e14 < x < -1.50000000000000006e-26 or 1.9999999999999999e-188 < x

    1. Initial program 68.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    10. Simplified42.3%

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

    if -1.50000000000000006e-26 < x < -2.09999999999999992e-137

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    if -2.09999999999999992e-137 < x < 1.9999999999999999e-188

    1. Initial program 65.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.05 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-188}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 13: 59.0% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{+15}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-25} \lor \neg \left(x \leq -7.5 \cdot 10^{-135}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -4.9e+15)
   (/ y (* x x))
   (if (or (<= x -4.8e-25) (not (<= x -7.5e-135)))
     (/ x (* y (+ y 1.0)))
     (/ y x))))
double code(double x, double y) {
	double tmp;
	if (x <= -4.9e+15) {
		tmp = y / (x * x);
	} else if ((x <= -4.8e-25) || !(x <= -7.5e-135)) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = y / x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-4.9d+15)) then
        tmp = y / (x * x)
    else if ((x <= (-4.8d-25)) .or. (.not. (x <= (-7.5d-135)))) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = y / x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -4.9e+15) {
		tmp = y / (x * x);
	} else if ((x <= -4.8e-25) || !(x <= -7.5e-135)) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = y / x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -4.9e+15:
		tmp = y / (x * x)
	elif (x <= -4.8e-25) or not (x <= -7.5e-135):
		tmp = x / (y * (y + 1.0))
	else:
		tmp = y / x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -4.9e+15)
		tmp = Float64(y / Float64(x * x));
	elseif ((x <= -4.8e-25) || !(x <= -7.5e-135))
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(y / x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4.9e+15)
		tmp = y / (x * x);
	elseif ((x <= -4.8e-25) || ~((x <= -7.5e-135)))
		tmp = x / (y * (y + 1.0));
	else
		tmp = y / x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -4.9e+15], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -4.8e-25], N[Not[LessEqual[x, -7.5e-135]], $MachinePrecision]], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-25} \lor \neg \left(x \leq -7.5 \cdot 10^{-135}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

    if -4.9e15 < x < -4.80000000000000018e-25 or -7.5e-135 < x

    1. Initial program 67.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.0%

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

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

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

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

    if -4.80000000000000018e-25 < x < -7.5e-135

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.9 \cdot 10^{+15}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-25} \lor \neg \left(x \leq -7.5 \cdot 10^{-135}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]

Alternative 14: 60.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-25}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -5.4e+14)
   (/ (/ y x) (+ x 1.0))
   (if (<= x -1.2e-25)
     (/ x (* y (+ y 1.0)))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -5.4e+14) {
		tmp = (y / x) / (x + 1.0);
	} else if (x <= -1.2e-25) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-5.4d+14)) then
        tmp = (y / x) / (x + 1.0d0)
    else if (x <= (-1.2d-25)) then
        tmp = x / (y * (y + 1.0d0))
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -5.4e+14) {
		tmp = (y / x) / (x + 1.0);
	} else if (x <= -1.2e-25) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -5.4e+14:
		tmp = (y / x) / (x + 1.0)
	elif x <= -1.2e-25:
		tmp = x / (y * (y + 1.0))
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -5.4e+14)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	elseif (x <= -1.2e-25)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -5.4e+14)
		tmp = (y / x) / (x + 1.0);
	elseif (x <= -1.2e-25)
		tmp = x / (y * (y + 1.0));
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -5.4e+14], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.2e-25], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.4 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

    if -5.4e14 < x < -1.20000000000000005e-25

    1. Initial program 74.5%

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

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

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

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

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

    if -1.20000000000000005e-25 < x < -1.00000000000000004e-134

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac82.9%

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

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

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

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

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

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

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

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

Alternative 15: 60.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x}\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-23}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -5.5e+14)
   (/ (/ y (+ x y)) x)
   (if (<= x -1.8e-23)
     (/ x (* y (+ y 1.0)))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -5.5e+14) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.8e-23) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-5.5d+14)) then
        tmp = (y / (x + y)) / x
    else if (x <= (-1.8d-23)) then
        tmp = x / (y * (y + 1.0d0))
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -5.5e+14) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.8e-23) {
		tmp = x / (y * (y + 1.0));
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -5.5e+14:
		tmp = (y / (x + y)) / x
	elif x <= -1.8e-23:
		tmp = x / (y * (y + 1.0))
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -5.5e+14)
		tmp = Float64(Float64(y / Float64(x + y)) / x);
	elseif (x <= -1.8e-23)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -5.5e+14)
		tmp = (y / (x + y)) / x;
	elseif (x <= -1.8e-23)
		tmp = x / (y * (y + 1.0));
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -5.5e+14], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.8e-23], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x}\\

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

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5e14 < x < -1.7999999999999999e-23

    1. Initial program 74.5%

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

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

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

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

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

    if -1.7999999999999999e-23 < x < -1.00000000000000004e-134

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac82.9%

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

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

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

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

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

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

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

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

Alternative 16: 60.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -7.5e+14)
   (/ (/ y (+ x y)) x)
   (if (<= x -1.5e-26)
     (/ (/ x (+ x y)) (+ y 1.0))
     (if (<= x -1e-134) (/ y x) (/ (/ x y) (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -7.5e+14) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.5e-26) {
		tmp = (x / (x + y)) / (y + 1.0);
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-7.5d+14)) then
        tmp = (y / (x + y)) / x
    else if (x <= (-1.5d-26)) then
        tmp = (x / (x + y)) / (y + 1.0d0)
    else if (x <= (-1d-134)) then
        tmp = y / x
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -7.5e+14) {
		tmp = (y / (x + y)) / x;
	} else if (x <= -1.5e-26) {
		tmp = (x / (x + y)) / (y + 1.0);
	} else if (x <= -1e-134) {
		tmp = y / x;
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -7.5e+14:
		tmp = (y / (x + y)) / x
	elif x <= -1.5e-26:
		tmp = (x / (x + y)) / (y + 1.0)
	elif x <= -1e-134:
		tmp = y / x
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -7.5e+14)
		tmp = Float64(Float64(y / Float64(x + y)) / x);
	elseif (x <= -1.5e-26)
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	elseif (x <= -1e-134)
		tmp = Float64(y / x);
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -7.5e+14)
		tmp = (y / (x + y)) / x;
	elseif (x <= -1.5e-26)
		tmp = (x / (x + y)) / (y + 1.0);
	elseif (x <= -1e-134)
		tmp = y / x;
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -7.5e+14], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.5e-26], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-134], N[(y / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{\frac{y}{x + y}}{x}\\

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\

\mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 63.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e14 < x < -1.50000000000000006e-26

    1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000006e-26 < x < -1.00000000000000004e-134

    1. Initial program 86.1%

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

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

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

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

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

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

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

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

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

    if -1.00000000000000004e-134 < x

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac82.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.5 \cdot 10^{+14}:\\ \;\;\;\;\frac{\frac{y}{x + y}}{x}\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-134}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 17: 61.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9.2 \cdot 10^{-77}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 9.2e-77)
   (/ y (* x (+ x 1.0)))
   (if (<= y 1.9e+165) (/ x (* y (+ y 1.0))) (/ 1.0 (* y (/ y x))))))
double code(double x, double y) {
	double tmp;
	if (y <= 9.2e-77) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 1.9e+165) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 9.2d-77) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 1.9d+165) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = 1.0d0 / (y * (y / x))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 9.2e-77) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 1.9e+165) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 9.2e-77:
		tmp = y / (x * (x + 1.0))
	elif y <= 1.9e+165:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = 1.0 / (y * (y / x))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 9.2e-77)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 1.9e+165)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(1.0 / Float64(y * Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 9.2e-77)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 1.9e+165)
		tmp = x / (y * (y + 1.0));
	else
		tmp = 1.0 / (y * (y / x));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 9.2e-77], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e+165], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

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

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


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

    1. Initial program 67.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.7%

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

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

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

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

    if 9.19999999999999994e-77 < y < 1.89999999999999995e165

    1. Initial program 80.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac93.9%

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

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

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

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

    if 1.89999999999999995e165 < y

    1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\color{blue}{y \cdot y}}{x}} \]
      2. associate-*l/85.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{y}{x} \cdot y}} \]
      3. *-commutative85.9%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \frac{y}{x}}} \]
    13. Simplified85.9%

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

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

Alternative 18: 61.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 9.8 \cdot 10^{-77}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 9.8e-77)
   (/ y (+ x (* x x)))
   (if (<= y 2.3e+165) (/ x (* y (+ y 1.0))) (/ 1.0 (* y (/ y x))))))
double code(double x, double y) {
	double tmp;
	if (y <= 9.8e-77) {
		tmp = y / (x + (x * x));
	} else if (y <= 2.3e+165) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 9.8d-77) then
        tmp = y / (x + (x * x))
    else if (y <= 2.3d+165) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = 1.0d0 / (y * (y / x))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 9.8e-77) {
		tmp = y / (x + (x * x));
	} else if (y <= 2.3e+165) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = 1.0 / (y * (y / x));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 9.8e-77:
		tmp = y / (x + (x * x))
	elif y <= 2.3e+165:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = 1.0 / (y * (y / x))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 9.8e-77)
		tmp = Float64(y / Float64(x + Float64(x * x)));
	elseif (y <= 2.3e+165)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(1.0 / Float64(y * Float64(y / x)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 9.8e-77)
		tmp = y / (x + (x * x));
	elseif (y <= 2.3e+165)
		tmp = x / (y * (y + 1.0));
	else
		tmp = 1.0 / (y * (y / x));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 9.8e-77], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+165], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 9.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\

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

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


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

    1. Initial program 67.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.7999999999999994e-77 < y < 2.30000000000000016e165

    1. Initial program 80.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac93.9%

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

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

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

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

    if 2.30000000000000016e165 < y

    1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\color{blue}{y \cdot y}}{x}} \]
      2. associate-*l/85.9%

        \[\leadsto \frac{1}{\color{blue}{\frac{y}{x} \cdot y}} \]
      3. *-commutative85.9%

        \[\leadsto \frac{1}{\color{blue}{y \cdot \frac{y}{x}}} \]
    13. Simplified85.9%

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

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

Alternative 19: 44.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.1 \cdot 10^{-183}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 2.1e-183) (/ y x) (if (<= y 0.75) (- (/ x y) x) (/ x (* y y)))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.1e-183) {
		tmp = y / x;
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.1d-183) then
        tmp = y / x
    else if (y <= 0.75d0) then
        tmp = (x / y) - x
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.1e-183) {
		tmp = y / x;
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.1e-183:
		tmp = y / x
	elif y <= 0.75:
		tmp = (x / y) - x
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.1e-183)
		tmp = Float64(y / x);
	elseif (y <= 0.75)
		tmp = Float64(Float64(x / y) - x);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.1e-183)
		tmp = y / x;
	elseif (y <= 0.75)
		tmp = (x / y) - x;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.1e-183], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\

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


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

    1. Initial program 65.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.0%

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

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

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

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

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

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

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

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

    if 2.1000000000000002e-183 < y < 0.75

    1. Initial program 88.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac94.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.75 < y

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 20: 61.6% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-77}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 2.3e-77) (/ y (+ x (* x x))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.3e-77) {
		tmp = y / (x + (x * x));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.3d-77) then
        tmp = y / (x + (x * x))
    else
        tmp = (x / y) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.3e-77) {
		tmp = y / (x + (x * x));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.3e-77:
		tmp = y / (x + (x * x))
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.3e-77)
		tmp = Float64(y / Float64(x + Float64(x * x)));
	else
		tmp = Float64(Float64(x / y) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.3e-77)
		tmp = y / (x + (x * x));
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.3e-77], N[(y / N[(x + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-77}:\\
\;\;\;\;\frac{y}{x + x \cdot x}\\

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


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

    1. Initial program 67.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999999e-77 < y

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

Alternative 21: 34.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-183}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 1.6e-183) (/ y x) (/ 1.0 (/ y x))))
double code(double x, double y) {
	double tmp;
	if (y <= 1.6e-183) {
		tmp = y / x;
	} else {
		tmp = 1.0 / (y / x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.6d-183) then
        tmp = y / x
    else
        tmp = 1.0d0 / (y / x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.6e-183) {
		tmp = y / x;
	} else {
		tmp = 1.0 / (y / x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 1.6e-183:
		tmp = y / x
	else:
		tmp = 1.0 / (y / x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 1.6e-183)
		tmp = Float64(y / x);
	else
		tmp = Float64(1.0 / Float64(y / x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.6e-183)
		tmp = y / x;
	else
		tmp = 1.0 / (y / x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 1.6e-183], N[(y / x), $MachinePrecision], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 65.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 1.6000000000000001e-183 < y

    1. Initial program 72.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+l+89.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.2%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 62.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*63.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative63.2%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified63.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
    7. Step-by-step derivation
      1. clear-num62.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      2. inv-pow62.5%

        \[\leadsto \color{blue}{{\left(\frac{y + 1}{\frac{x}{y}}\right)}^{-1}} \]
      3. div-inv62.5%

        \[\leadsto {\color{blue}{\left(\left(y + 1\right) \cdot \frac{1}{\frac{x}{y}}\right)}}^{-1} \]
      4. clear-num62.5%

        \[\leadsto {\left(\left(y + 1\right) \cdot \color{blue}{\frac{y}{x}}\right)}^{-1} \]
    8. Applied egg-rr62.5%

      \[\leadsto \color{blue}{{\left(\left(y + 1\right) \cdot \frac{y}{x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-162.6%

        \[\leadsto \color{blue}{\frac{1}{\left(y + 1\right) \cdot \frac{y}{x}}} \]
      2. *-commutative62.6%

        \[\leadsto \frac{1}{\color{blue}{\frac{y}{x} \cdot \left(y + 1\right)}} \]
    10. Simplified62.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x} \cdot \left(y + 1\right)}} \]
    11. Taylor expanded in y around 0 30.9%

      \[\leadsto \frac{1}{\color{blue}{\frac{y}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification35.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.6 \cdot 10^{-183}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{y}{x}}\\ \end{array} \]

Alternative 22: 33.8% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 2.2e-183) (/ y x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (y <= 2.2e-183) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.2d-183) then
        tmp = y / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.2e-183) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.2e-183:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.2e-183)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.2e-183)
		tmp = y / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.2e-183], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.2e-183

    1. Initial program 65.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac83.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+l+83.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified83.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 56.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*58.2%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative58.2%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    6. Simplified58.2%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]
    7. Taylor expanded in x around 0 38.4%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 2.2e-183 < y

    1. Initial program 72.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. associate-+l+89.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.2%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 62.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. associate-/r*63.2%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative63.2%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    6. Simplified63.2%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
    7. Taylor expanded in y around 0 29.6%

      \[\leadsto \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-183}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 23: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{y} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 y))
double code(double x, double y) {
	return 1.0 / y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / y
end function
public static double code(double x, double y) {
	return 1.0 / y;
}
def code(x, y):
	return 1.0 / y
function code(x, y)
	return Float64(1.0 / y)
end
function tmp = code(x, y)
	tmp = 1.0 / y;
end
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{y}
\end{array}
Derivation
  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. times-frac85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. associate-+l+85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified85.6%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Step-by-step derivation
    1. *-commutative85.6%

      \[\leadsto \color{blue}{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    2. clear-num85.6%

      \[\leadsto \color{blue}{\frac{1}{\frac{x + \left(y + 1\right)}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
    3. associate-/r*99.7%

      \[\leadsto \frac{1}{\frac{x + \left(y + 1\right)}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
    4. frac-times99.2%

      \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{x + y}}{\frac{x + \left(y + 1\right)}{y} \cdot \left(x + y\right)}} \]
    5. *-un-lft-identity99.2%

      \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + \left(y + 1\right)}{y} \cdot \left(x + y\right)} \]
  5. Applied egg-rr99.2%

    \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{x + \left(y + 1\right)}{y} \cdot \left(x + y\right)}} \]
  6. Taylor expanded in x around inf 50.5%

    \[\leadsto \frac{\color{blue}{1}}{\frac{x + \left(y + 1\right)}{y} \cdot \left(x + y\right)} \]
  7. Taylor expanded in y around inf 4.0%

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  8. Final simplification4.0%

    \[\leadsto \frac{1}{y} \]

Alternative 24: 25.8% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
	return x / y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / y
end function
public static double code(double x, double y) {
	return x / y;
}
def code(x, y):
	return x / y
function code(x, y)
	return Float64(x / y)
end
function tmp = code(x, y)
	tmp = x / y;
end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y}
\end{array}
Derivation
  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. times-frac85.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. associate-+l+85.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified85.6%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in x around 0 50.6%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  5. Step-by-step derivation
    1. associate-/r*51.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
    2. +-commutative51.4%

      \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
  6. Simplified51.4%

    \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  7. Taylor expanded in y around 0 26.6%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  8. Final simplification26.6%

    \[\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 2023297 
(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))))