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

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

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

Initial Program: 69.2% 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{\frac{x}{x + y}}{\frac{x}{y} + 1}}{x + \left(y + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ x y)) (+ (/ x y) 1.0)) (+ x (+ y 1.0))))
double code(double x, double y) {
	return ((x / (x + y)) / ((x / y) + 1.0)) / (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) + 1.0d0)) / (x + (y + 1.0d0))
end function
public static double code(double x, double y) {
	return ((x / (x + y)) / ((x / y) + 1.0)) / (x + (y + 1.0));
}
def code(x, y):
	return ((x / (x + y)) / ((x / y) + 1.0)) / (x + (y + 1.0))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(x + y)) / Float64(Float64(x / y) + 1.0)) / Float64(x + Float64(y + 1.0)))
end
function tmp = code(x, y)
	tmp = ((x / (x + y)) / ((x / y) + 1.0)) / (x + (y + 1.0));
end
code[x_, y_] := N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{x + y}}{\frac{x}{y} + 1}}{x + \left(y + 1\right)}
\end{array}
Derivation
  1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 75.6% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4499999999999999e-69

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e-69 < y < 1.2e-48

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-48 < y < 1.6e99

    1. Initial program 90.7%

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

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

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

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

    if 1.6e99 < y

    1. Initial program 56.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-69}:\\ \;\;\;\;\frac{\frac{\frac{x}{x}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-48}:\\ \;\;\;\;\frac{y}{\left(x + y\right) \cdot \left(\left(x + 1\right) + y \cdot \frac{1}{x}\right)}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+99}:\\ \;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.0% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e181 < x < -2.35e-7

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.35e-7 < x < 5.39999999999999993e71

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.39999999999999993e71 < x

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 69.7% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000006e181 < x < -9.9999999999999995e-8

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999995e-8 < x < -1.5800000000000001e-162

    1. Initial program 90.3%

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

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

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

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

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

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

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

    if -1.5800000000000001e-162 < x

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

    if -1.70000000000000006e75 < y < 3.7999999999999998e154

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999998e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 83.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

    if -4.1000000000000002e105 < y < 6.79999999999999948e154

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

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

    if 6.79999999999999948e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.6% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 55.8%

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

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

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

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

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

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

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

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

    if -4.1000000000000002e105 < y < 1.50000000000000013e154

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

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

    if 1.50000000000000013e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 75.3% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4499999999999999e-69

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e-69 < y < 5.80000000000000037e-15

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.80000000000000037e-15 < y < 2.70000000000000006e154

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

    if 2.70000000000000006e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 74.8% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4499999999999999e-69

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e-69 < y < 5.80000000000000037e-15

    1. Initial program 68.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.80000000000000037e-15 < y < 2.50000000000000002e154

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000002e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 69.1% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 8.9999999999999995e-163

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative65.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999995e-163 < y < 5.80000000000000037e-15

    1. Initial program 91.3%

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

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

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

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

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

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

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

    if 5.80000000000000037e-15 < y < 1.35000000000000003e154

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 65.2% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around inf 54.7%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + \left(y + 1\right)} \]

    if 1.39999999999999994e-169 < y < 1.4e154

    1. Initial program 85.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative85.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*85.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac98.0%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative98.0%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative98.0%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+98.0%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative98.0%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+98.0%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr98.0%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Taylor expanded in y around inf 77.2%

      \[\leadsto \color{blue}{1} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \]

    if 1.4e154 < 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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative53.1%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*53.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac76.1%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative76.1%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative76.1%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+76.1%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative76.1%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+76.1%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr76.1%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative76.1%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.9%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.9%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times98.5%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative98.5%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative98.5%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative98.5%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr98.5%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Step-by-step derivation
      1. *-rgt-identity98.5%

        \[\leadsto \frac{\color{blue}{\left(\frac{x}{x + y} \cdot 1\right)} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      2. *-commutative98.5%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{x}{x + y} \cdot 1\right)}}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      3. times-frac99.8%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}}} \]
      4. associate-+r+99.8%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      6. associate-+l+99.8%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      7. *-rgt-identity99.8%

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around 0 84.0%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + \left(y + 1\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.4 \cdot 10^{-169}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 5.2e-85)
   (/ (/ y x) (+ x 1.0))
   (if (<= y 6e+103) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} else if (y <= 6e+103) {
		tmp = x / (y * (y + 1.0));
	} 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 <= 5.2d-85) then
        tmp = (y / x) / (x + 1.0d0)
    else if (y <= 6d+103) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} else if (y <= 6e+103) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5.2e-85:
		tmp = (y / x) / (x + 1.0)
	elif y <= 6e+103:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5.2e-85)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	elseif (y <= 6e+103)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5.2e-85)
		tmp = (y / x) / (x + 1.0);
	elseif (y <= 6e+103)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5.2e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e+103], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.20000000000000023e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 51.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*55.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.8%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified55.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 5.20000000000000023e-85 < y < 6e103

    1. Initial program 92.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*92.5%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+92.5%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified92.5%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 61.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative61.0%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified61.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 6e103 < y

    1. Initial program 56.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*75.6%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+75.6%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified75.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 77.9%

      \[\leadsto x \cdot \color{blue}{\frac{1}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*77.9%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{1 + y}} \]
      2. +-commutative77.9%

        \[\leadsto x \cdot \frac{\frac{1}{y}}{\color{blue}{y + 1}} \]
    7. Simplified77.9%

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*r/84.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y}}{y + 1}} \]
      2. frac-2neg84.2%

        \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    9. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/84.2%

        \[\leadsto \frac{-\color{blue}{\frac{x \cdot 1}{y}}}{-\left(y + 1\right)} \]
      2. *-rgt-identity84.2%

        \[\leadsto \frac{-\frac{\color{blue}{x}}{y}}{-\left(y + 1\right)} \]
      3. +-commutative84.2%

        \[\leadsto \frac{-\frac{x}{y}}{-\color{blue}{\left(1 + y\right)}} \]
      4. mul-1-neg84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot \left(1 + y\right)}} \]
      5. distribute-lft-in84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot 1 + -1 \cdot y}} \]
      6. metadata-eval84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1} + -1 \cdot y} \]
      7. neg-mul-184.2%

        \[\leadsto \frac{-\frac{x}{y}}{-1 + \color{blue}{\left(-y\right)}} \]
      8. unsub-neg84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 - y}} \]
    11. Simplified84.2%

      \[\leadsto \color{blue}{\frac{-\frac{x}{y}}{-1 - y}} \]
    12. Taylor expanded in y around inf 84.2%

      \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot y}} \]
    13. Step-by-step derivation
      1. neg-mul-184.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-y}} \]
    14. Simplified84.2%

      \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 61.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.9 \cdot 10^{-85}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.9e-85)
   (/ y (* x (+ x 1.0)))
   (if (<= y 6.1e+103) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.9e-85) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 6.1e+103) {
		tmp = x / (y * (y + 1.0));
	} 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 <= 4.9d-85) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 6.1d+103) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.9e-85) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 6.1e+103) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.9e-85:
		tmp = y / (x * (x + 1.0))
	elif y <= 6.1e+103:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.9e-85)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 6.1e+103)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.9e-85)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 6.1e+103)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.9e-85], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.1e+103], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.9 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{elif}\;y \leq 6.1 \cdot 10^{+103}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 4.90000000000000015e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 51.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]

    if 4.90000000000000015e-85 < y < 6.1000000000000002e103

    1. Initial program 92.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*92.5%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+92.5%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified92.5%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 61.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative61.0%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified61.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 6.1000000000000002e103 < y

    1. Initial program 56.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*75.6%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+75.6%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified75.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 77.9%

      \[\leadsto x \cdot \color{blue}{\frac{1}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*77.9%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{1 + y}} \]
      2. +-commutative77.9%

        \[\leadsto x \cdot \frac{\frac{1}{y}}{\color{blue}{y + 1}} \]
    7. Simplified77.9%

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*r/84.2%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y}}{y + 1}} \]
      2. frac-2neg84.2%

        \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    9. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/84.2%

        \[\leadsto \frac{-\color{blue}{\frac{x \cdot 1}{y}}}{-\left(y + 1\right)} \]
      2. *-rgt-identity84.2%

        \[\leadsto \frac{-\frac{\color{blue}{x}}{y}}{-\left(y + 1\right)} \]
      3. +-commutative84.2%

        \[\leadsto \frac{-\frac{x}{y}}{-\color{blue}{\left(1 + y\right)}} \]
      4. mul-1-neg84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot \left(1 + y\right)}} \]
      5. distribute-lft-in84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot 1 + -1 \cdot y}} \]
      6. metadata-eval84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1} + -1 \cdot y} \]
      7. neg-mul-184.2%

        \[\leadsto \frac{-\frac{x}{y}}{-1 + \color{blue}{\left(-y\right)}} \]
      8. unsub-neg84.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 - y}} \]
    11. Simplified84.2%

      \[\leadsto \color{blue}{\frac{-\frac{x}{y}}{-1 - y}} \]
    12. Taylor expanded in y around inf 84.2%

      \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot y}} \]
    13. Step-by-step derivation
      1. neg-mul-184.2%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-y}} \]
    14. Simplified84.2%

      \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification58.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.9 \cdot 10^{-85}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{+103}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 61.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 6.8 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 6.8e-100) (/ (/ y x) (+ x (+ y 1.0))) (/ (/ x (+ x y)) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (y <= 6.8e-100) {
		tmp = (y / x) / (x + (y + 1.0));
	} else {
		tmp = (x / (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 <= 6.8d-100) then
        tmp = (y / x) / (x + (y + 1.0d0))
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 6.8e-100) {
		tmp = (y / x) / (x + (y + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 6.8e-100:
		tmp = (y / x) / (x + (y + 1.0))
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 6.8e-100)
		tmp = Float64(Float64(y / x) / Float64(x + Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 6.8e-100)
		tmp = (y / x) / (x + (y + 1.0));
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 6.8e-100], N[(N[(y / x), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-100}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.79999999999999953e-100

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative66.6%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*66.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac93.5%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative93.5%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr93.5%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative93.5%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Step-by-step derivation
      1. *-rgt-identity99.8%

        \[\leadsto \frac{\color{blue}{\left(\frac{x}{x + y} \cdot 1\right)} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      2. *-commutative99.8%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{x}{x + y} \cdot 1\right)}}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      3. times-frac99.7%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}}} \]
      4. associate-+r+99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      6. associate-+l+99.7%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      7. *-rgt-identity99.7%

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around inf 55.9%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + \left(y + 1\right)} \]

    if 6.79999999999999953e-100 < y

    1. Initial program 74.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative74.2%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*74.2%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac88.5%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative88.5%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative88.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+88.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative88.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+88.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr88.5%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative88.5%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times99.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Taylor expanded in x around 0 72.7%

      \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\color{blue}{1 + y}} \]
    8. Step-by-step derivation
      1. +-commutative72.7%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\color{blue}{y + 1}} \]
    9. Simplified72.7%

      \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\color{blue}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.8 \cdot 10^{-100}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 62.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \left(y + 1\right)\\ \mathbf{if}\;y \leq 5 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t\_0}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (+ x (+ y 1.0))))
   (if (<= y 5e-85) (/ (/ y x) t_0) (/ (/ x y) t_0))))
double code(double x, double y) {
	double t_0 = x + (y + 1.0);
	double tmp;
	if (y <= 5e-85) {
		tmp = (y / x) / t_0;
	} else {
		tmp = (x / y) / 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 + 1.0d0)
    if (y <= 5d-85) then
        tmp = (y / x) / t_0
    else
        tmp = (x / y) / t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x + (y + 1.0);
	double tmp;
	if (y <= 5e-85) {
		tmp = (y / x) / t_0;
	} else {
		tmp = (x / y) / t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = x + (y + 1.0)
	tmp = 0
	if y <= 5e-85:
		tmp = (y / x) / t_0
	else:
		tmp = (x / y) / t_0
	return tmp
function code(x, y)
	t_0 = Float64(x + Float64(y + 1.0))
	tmp = 0.0
	if (y <= 5e-85)
		tmp = Float64(Float64(y / x) / t_0);
	else
		tmp = Float64(Float64(x / y) / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x + (y + 1.0);
	tmp = 0.0;
	if (y <= 5e-85)
		tmp = (y / x) / t_0;
	else
		tmp = (x / y) / t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e-85], N[(N[(y / x), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 5 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.0000000000000002e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative66.7%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*66.7%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac93.5%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative93.5%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+93.5%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr93.5%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative93.5%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative99.8%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Step-by-step derivation
      1. *-rgt-identity99.8%

        \[\leadsto \frac{\color{blue}{\left(\frac{x}{x + y} \cdot 1\right)} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      2. *-commutative99.8%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{x}{x + y} \cdot 1\right)}}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      3. times-frac99.7%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}}} \]
      4. associate-+r+99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      6. associate-+l+99.7%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      7. *-rgt-identity99.7%

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.8%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.8%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around inf 56.1%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + \left(y + 1\right)} \]

    if 5.0000000000000002e-85 < y

    1. Initial program 73.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative73.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*73.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac88.3%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative88.3%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr88.3%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative88.3%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times99.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Step-by-step derivation
      1. *-rgt-identity99.1%

        \[\leadsto \frac{\color{blue}{\left(\frac{x}{x + y} \cdot 1\right)} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      2. *-commutative99.1%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{x}{x + y} \cdot 1\right)}}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      3. times-frac99.7%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}}} \]
      4. associate-+r+99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      6. associate-+l+99.7%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      7. *-rgt-identity99.7%

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.7%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around 0 73.4%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + \left(y + 1\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 61.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 5.2e-85) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ x (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (x + (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 <= 5.2d-85) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = (x / y) / (x + (y + 1.0d0))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (x + (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5.2e-85:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / y) / (x + (y + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5.2e-85)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / y) / Float64(x + Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5.2e-85)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / y) / (x + (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5.2e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{x + \left(y + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.20000000000000023e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 51.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*55.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.8%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified55.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 5.20000000000000023e-85 < y

    1. Initial program 73.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative73.9%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-*l*73.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      3. times-frac88.3%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. +-commutative88.3%

        \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. +-commutative88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      6. associate-+r+88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
      8. associate-+l+88.3%

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
    4. Applied egg-rr88.3%

      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
    5. Step-by-step derivation
      1. *-commutative88.3%

        \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)} \cdot \frac{y}{y + x}} \]
      2. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + \left(1 + x\right)}} \cdot \frac{y}{y + x} \]
      3. clear-num99.8%

        \[\leadsto \frac{\frac{x}{y + x}}{y + \left(1 + x\right)} \cdot \color{blue}{\frac{1}{\frac{y + x}{y}}} \]
      4. frac-times99.1%

        \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}}} \]
      5. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}} \cdot 1}{\left(y + \left(1 + x\right)\right) \cdot \frac{y + x}{y}} \]
      6. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \color{blue}{\left(x + 1\right)}\right) \cdot \frac{y + x}{y}} \]
      7. +-commutative99.1%

        \[\leadsto \frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{\color{blue}{x + y}}{y}} \]
    6. Applied egg-rr99.1%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}}} \]
    7. Step-by-step derivation
      1. *-rgt-identity99.1%

        \[\leadsto \frac{\color{blue}{\left(\frac{x}{x + y} \cdot 1\right)} \cdot 1}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      2. *-commutative99.1%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{x}{x + y} \cdot 1\right)}}{\left(y + \left(x + 1\right)\right) \cdot \frac{x + y}{y}} \]
      3. times-frac99.7%

        \[\leadsto \color{blue}{\frac{1}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}}} \]
      4. associate-+r+99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(y + x\right) + 1}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      5. +-commutative99.7%

        \[\leadsto \frac{1}{\color{blue}{\left(x + y\right)} + 1} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      6. associate-+l+99.7%

        \[\leadsto \frac{1}{\color{blue}{x + \left(y + 1\right)}} \cdot \frac{\frac{x}{x + y} \cdot 1}{\frac{x + y}{y}} \]
      7. *-rgt-identity99.7%

        \[\leadsto \frac{1}{x + \left(y + 1\right)} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{\frac{x + y}{y}} \]
    8. Applied egg-rr99.7%

      \[\leadsto \color{blue}{\frac{1}{x + \left(y + 1\right)} \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}} \]
    9. Step-by-step derivation
      1. associate-*l/99.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
      2. *-lft-identity99.7%

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}}{x + \left(y + 1\right)} \]
    10. Simplified99.7%

      \[\leadsto \color{blue}{\frac{\frac{\frac{x}{x + y}}{\frac{x + y}{y}}}{x + \left(y + 1\right)}} \]
    11. Taylor expanded in x around 0 73.4%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + \left(y + 1\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 61.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 5.2e-85) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} 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 <= 5.2d-85) then
        tmp = (y / x) / (x + 1.0d0)
    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 <= 5.2e-85) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5.2e-85:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5.2e-85)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	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 <= 5.2e-85)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5.2e-85], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.20000000000000023e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 51.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*55.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative55.8%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified55.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 5.20000000000000023e-85 < y

    1. Initial program 73.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*83.8%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+83.8%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified83.8%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 69.6%

      \[\leadsto x \cdot \color{blue}{\frac{1}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*69.7%

        \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{1 + y}} \]
      2. +-commutative69.7%

        \[\leadsto x \cdot \frac{\frac{1}{y}}{\color{blue}{y + 1}} \]
    7. Simplified69.7%

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*r/72.8%

        \[\leadsto \color{blue}{\frac{x \cdot \frac{1}{y}}{y + 1}} \]
      2. frac-2neg72.8%

        \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    9. Applied egg-rr72.8%

      \[\leadsto \color{blue}{\frac{-x \cdot \frac{1}{y}}{-\left(y + 1\right)}} \]
    10. Step-by-step derivation
      1. associate-*r/72.9%

        \[\leadsto \frac{-\color{blue}{\frac{x \cdot 1}{y}}}{-\left(y + 1\right)} \]
      2. *-rgt-identity72.9%

        \[\leadsto \frac{-\frac{\color{blue}{x}}{y}}{-\left(y + 1\right)} \]
      3. +-commutative72.9%

        \[\leadsto \frac{-\frac{x}{y}}{-\color{blue}{\left(1 + y\right)}} \]
      4. mul-1-neg72.9%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot \left(1 + y\right)}} \]
      5. distribute-lft-in72.9%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 \cdot 1 + -1 \cdot y}} \]
      6. metadata-eval72.9%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1} + -1 \cdot y} \]
      7. neg-mul-172.9%

        \[\leadsto \frac{-\frac{x}{y}}{-1 + \color{blue}{\left(-y\right)}} \]
      8. unsub-neg72.9%

        \[\leadsto \frac{-\frac{x}{y}}{\color{blue}{-1 - y}} \]
    11. Simplified72.9%

      \[\leadsto \color{blue}{\frac{-\frac{x}{y}}{-1 - y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 60.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 5.2e-85) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (y <= 5.2e-85) {
		tmp = y / (x * (x + 1.0));
	} 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 <= 5.2d-85) then
        tmp = y / (x * (x + 1.0d0))
    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 <= 5.2e-85) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5.2e-85:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = x / (y * (y + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5.2e-85)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5.2e-85)
		tmp = y / (x * (x + 1.0));
	else
		tmp = x / (y * (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5.2e-85], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.20000000000000023e-85

    1. Initial program 66.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 51.9%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]

    if 5.20000000000000023e-85 < y

    1. Initial program 73.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*83.8%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+83.8%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified83.8%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 69.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative69.7%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified69.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification57.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.2 \cdot 10^{-85}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 27.0% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.1:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x -1.1) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (x <= -1.1) {
		tmp = 1.0 / 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 (x <= (-1.1d0)) then
        tmp = 1.0d0 / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.1) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -1.1:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -1.1)
		tmp = Float64(1.0 / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.1)
		tmp = 1.0 / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -1.1], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1:\\
\;\;\;\;\frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.1000000000000001

    1. Initial program 62.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 58.0%

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{x}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    4. Taylor expanded in x around inf 57.9%

      \[\leadsto \frac{x \cdot y}{\left(\color{blue}{x} \cdot x\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    5. Taylor expanded in y around inf 6.6%

      \[\leadsto \color{blue}{\frac{1}{x}} \]

    if -1.1000000000000001 < x

    1. Initial program 71.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*82.7%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+82.7%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified82.7%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 62.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative62.5%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified62.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Taylor expanded in y around 0 35.6%

      \[\leadsto \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 48.6% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \frac{x}{y \cdot \left(y + 1\right)} \end{array} \]
(FPCore (x y) :precision binary64 (/ x (* y (+ y 1.0))))
double code(double x, double y) {
	return x / (y * (y + 1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / (y * (y + 1.0d0))
end function
public static double code(double x, double y) {
	return x / (y * (y + 1.0));
}
def code(x, y):
	return x / (y * (y + 1.0))
function code(x, y)
	return Float64(x / Float64(y * Float64(y + 1.0)))
end
function tmp = code(x, y)
	tmp = x / (y * (y + 1.0));
end
code[x_, y_] := N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y \cdot \left(y + 1\right)}
\end{array}
Derivation
  1. Initial program 69.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. associate-/l*80.6%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    2. associate-+l+80.6%

      \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
  3. Simplified80.6%

    \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 52.0%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  6. Step-by-step derivation
    1. +-commutative52.0%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
  7. Simplified52.0%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  8. Add Preprocessing

Alternative 21: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
	return 1.0 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
public static double code(double x, double y) {
	return 1.0 / x;
}
def code(x, y):
	return 1.0 / x
function code(x, y)
	return Float64(1.0 / x)
end
function tmp = code(x, y)
	tmp = 1.0 / x;
end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 69.0%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 37.4%

    \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{x}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  4. Taylor expanded in x around inf 31.5%

    \[\leadsto \frac{x \cdot y}{\left(\color{blue}{x} \cdot x\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  5. Taylor expanded in y around inf 4.4%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  6. Add Preprocessing

Alternative 22: 3.5% accurate, 17.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 69.0%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutative69.0%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. associate-*l*69.0%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
    3. times-frac91.9%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    4. +-commutative91.9%

      \[\leadsto \frac{y}{\color{blue}{y + x}} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    5. +-commutative91.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
    6. associate-+r+91.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    7. +-commutative91.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + 1\right) + x\right)}} \]
    8. associate-+l+91.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(1 + x\right)\right)}} \]
  4. Applied egg-rr91.9%

    \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(1 + x\right)\right)}} \]
  5. Taylor expanded in x around 0 52.0%

    \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  6. Taylor expanded in y around 0 3.5%

    \[\leadsto \color{blue}{1} \]
  7. Add Preprocessing

Developer Target 1: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y):
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
end
function tmp = code(x, y)
	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}

Reproduce

?
herbie shell --seed 2024118 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))