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

Percentage Accurate: 69.6% → 99.8%
Time: 14.4s
Alternatives: 19
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 19 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.6% 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{y}{y + x} \cdot \frac{\frac{x}{y + x}}{\left(y + x\right) + 1} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ (+ y x) 1.0))))
double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + x)) / ((y + x) + 1.0));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y / (y + x)) * ((x / (y + x)) / ((y + x) + 1.0d0))
end function
public static double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + x)) / ((y + x) + 1.0));
}
def code(x, y):
	return (y / (y + x)) * ((x / (y + x)) / ((y + x) + 1.0))
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(Float64(y + x) + 1.0)))
end
function tmp = code(x, y)
	tmp = (y / (y + x)) * ((x / (y + x)) / ((y + x) + 1.0));
end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

      \[\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.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-frac92.1%

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

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

      \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    7. +-commutative92.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+92.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-rr92.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. add-exp-log63.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(y + x\right)}} \]
    9. +-commutative41.8%

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

    \[\leadsto \frac{y}{y + x} \cdot \color{blue}{e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
  7. Step-by-step derivation
    1. exp-diff41.8%

      \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{e^{\log \left(\frac{x}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
    2. rem-exp-log59.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
    3. log1p-undefine59.9%

      \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
    4. rem-exp-log99.8%

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

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

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

Alternative 2: 69.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 68.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*78.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+78.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. Simplified78.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 y around 0 57.2%

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

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

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

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

    if 2.6999999999999998e-165 < y < 2.9499999999999999e103

    1. Initial program 78.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*89.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+89.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. Simplified89.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

    if 2.9499999999999999e103 < y

    1. Initial program 47.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. *-commutative47.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*47.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-frac74.3%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative74.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+74.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-rr74.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. associate-/r*99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.8% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.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. *-commutative61.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*61.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-frac81.3%

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

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

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

      \[\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 0 75.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \log \left(1 + \color{blue}{\left(y + x\right)}\right)} \]
      8. log1p-undefine0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(y + x\right)}} \]
      9. +-commutative0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(\color{blue}{x + y}\right)} \]
    7. Applied egg-rr0.0%

      \[\leadsto \frac{y}{x} \cdot \color{blue}{e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    8. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{e^{\log \left(\frac{x}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log8.6%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      3. log1p-undefine8.6%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      4. rem-exp-log99.8%

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

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

    if -7.2000000000000002e42 < x < 4.35e15

    1. Initial program 72.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.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+82.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. Simplified82.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. Step-by-step derivation
      1. *-un-lft-identity82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.35e15 < x

    1. Initial program 64.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. *-commutative64.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*64.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-frac84.5%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative84.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+84.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-rr84.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-/r*99.8%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 4.2 \cdot 10^{-86}:\\
\;\;\;\;t\_0 \cdot \frac{y}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\

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


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

    1. Initial program 55.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. *-commutative55.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*55.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.9%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative73.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+73.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-rr73.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 y around 0 73.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \log \left(1 + \color{blue}{\left(y + x\right)}\right)} \]
      8. log1p-undefine0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(y + x\right)}} \]
      9. +-commutative0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(\color{blue}{x + y}\right)} \]
    7. Applied egg-rr0.0%

      \[\leadsto \frac{y}{x} \cdot \color{blue}{e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    8. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{e^{\log \left(\frac{x}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log5.4%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      3. log1p-undefine5.4%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      4. rem-exp-log100.0%

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

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

    if -3.75e168 < x < 4.2e-86

    1. Initial program 69.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. associate-*l*69.2%

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

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

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

        \[\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+97.9%

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

        \[\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+97.9%

        \[\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-rr97.9%

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

    if 4.2e-86 < x

    1. Initial program 71.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative71.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*71.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-frac88.0%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative88.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+88.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-rr88.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. associate-/r*99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 85.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
t_1 := \frac{x}{y + x}\\
\mathbf{if}\;x \leq -5.9 \cdot 10^{+168}:\\
\;\;\;\;\frac{t\_1}{\left(y + x\right) + 1} \cdot \frac{y}{x}\\

\mathbf{elif}\;x \leq 9 \cdot 10^{-11}:\\
\;\;\;\;t\_0 \cdot \frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(t\_1 \cdot \frac{1}{y}\right)\\


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

    1. Initial program 55.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. *-commutative55.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*55.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.9%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative73.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+73.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-rr73.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 y around 0 73.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \log \left(1 + \color{blue}{\left(y + x\right)}\right)} \]
      8. log1p-undefine0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(y + x\right)}} \]
      9. +-commutative0.0%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(\color{blue}{x + y}\right)} \]
    7. Applied egg-rr0.0%

      \[\leadsto \frac{y}{x} \cdot \color{blue}{e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    8. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{e^{\log \left(\frac{x}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log5.4%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      3. log1p-undefine5.4%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      4. rem-exp-log100.0%

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

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

    if -5.89999999999999986e168 < x < 8.9999999999999999e-11

    1. Initial program 70.8%

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

        \[\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.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-frac98.2%

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

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

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

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

    if 8.9999999999999999e-11 < x

    1. Initial program 66.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. *-commutative66.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*66.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-frac85.5%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative85.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+85.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-rr85.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-/r*99.7%

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

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

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

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

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

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

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

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

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

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

Alternative 6: 61.1% accurate, 0.8× speedup?

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

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

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

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

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


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

    1. Initial program 59.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. *-commutative59.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*59.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-frac80.4%

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

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

        \[\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+80.4%

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

        \[\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+80.4%

        \[\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-rr80.4%

      \[\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 0 74.8%

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

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

    if -2.39999999999999999e64 < x < -4.99999999999999993e-119

    1. Initial program 82.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*85.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+85.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. Simplified85.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 y around 0 48.1%

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

    if -4.99999999999999993e-119 < x < 4.2e-86

    1. Initial program 63.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*77.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+77.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. Simplified77.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 84.1%

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

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

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

    if 4.2e-86 < x

    1. Initial program 71.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative71.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*71.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-frac88.0%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative88.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+88.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-rr88.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. associate-/r*99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+64}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-119}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 64.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 68.9%

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

        \[\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+78.4%

        \[\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. Simplified78.4%

      \[\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 57.4%

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

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

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

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

    if 4.4999999999999998e-144 < y < 2.69999999999999989e146

    1. Initial program 72.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. *-commutative72.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*72.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.8%

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

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

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

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

    if 2.69999999999999989e146 < y

    1. Initial program 52.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative52.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*52.6%

        \[\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-frac68.7%

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

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

        \[\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+68.7%

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

        \[\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+68.7%

        \[\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-rr68.7%

      \[\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-/r*99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 70.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative70.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*70.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-frac89.1%

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

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

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

      \[\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 0 70.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \log \left(1 + \color{blue}{\left(y + x\right)}\right)} \]
      8. log1p-undefine13.6%

        \[\leadsto \frac{y}{y + x} \cdot e^{\log \left(\frac{x}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(y + x\right)}} \]
      9. +-commutative13.6%

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

      \[\leadsto \frac{y}{x} \cdot \color{blue}{e^{\log \left(\frac{x}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    8. Step-by-step derivation
      1. exp-diff13.6%

        \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{e^{\log \left(\frac{x}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log30.9%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\color{blue}{\frac{x}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      3. log1p-undefine30.9%

        \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      4. rem-exp-log99.8%

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

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

    if -3.6000000000000002e-149 < x

    1. Initial program 66.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative66.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*66.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-frac94.4%

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

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

        \[\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.4%

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

        \[\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.4%

        \[\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.4%

      \[\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-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 60.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\

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

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


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

    1. Initial program 62.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. *-commutative62.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*62.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-frac83.8%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative83.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+83.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-rr83.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 y around 0 75.3%

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

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

    if -1 < x < -4.99999999999999993e-119

    1. Initial program 84.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*89.2%

        \[\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+89.2%

        \[\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. Simplified89.2%

      \[\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 45.3%

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

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

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

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

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

    if -4.99999999999999993e-119 < x

    1. Initial program 67.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.2%

        \[\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.2%

        \[\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.2%

      \[\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 58.3%

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

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

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

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

Alternative 10: 60.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-125}:\\
\;\;\;\;\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 3 regimes
  2. if x < -1.5000000000000001e64

    1. Initial program 59.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. *-commutative59.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*59.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-frac80.4%

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

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

        \[\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+80.4%

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

        \[\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+80.4%

        \[\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-rr80.4%

      \[\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 0 74.8%

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

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

    if -1.5000000000000001e64 < x < -2.1e-125

    1. Initial program 82.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*85.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+85.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. Simplified85.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 y around 0 48.1%

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

    if -2.1e-125 < x

    1. Initial program 67.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.2%

        \[\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.2%

        \[\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.2%

      \[\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 58.3%

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

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

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

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

Alternative 11: 61.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.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. *-commutative59.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*59.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-frac80.4%

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

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

        \[\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+80.4%

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

        \[\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+80.4%

        \[\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-rr80.4%

      \[\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 0 74.8%

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

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

    if -1.2e64 < x < -1.10000000000000006e-120

    1. Initial program 82.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*85.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+85.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. Simplified85.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 y around 0 48.1%

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

    if -1.10000000000000006e-120 < x

    1. Initial program 67.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.2%

        \[\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.2%

        \[\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.2%

      \[\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 58.2%

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*r/60.0%

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y + 1} \]
    9. Applied egg-rr60.1%

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

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

Alternative 12: 61.6% accurate, 1.2× speedup?

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

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

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


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

    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*76.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+76.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. Simplified76.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 62.3%

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

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

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

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

    if -1.3499999999999999e-120 < x

    1. Initial program 67.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. *-commutative67.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*67.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-frac94.6%

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

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

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

      \[\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-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 61.8% accurate, 1.2× speedup?

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

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

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


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

    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-frac88.6%

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

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

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

      \[\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 0 67.8%

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

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

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

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

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

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

    if -4.80000000000000017e-119 < x

    1. Initial program 67.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. *-commutative67.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*67.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-frac94.6%

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

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

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

      \[\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-/r*99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 45.2% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\

\mathbf{elif}\;x \leq -7 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 62.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. *-commutative62.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*62.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-frac83.8%

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      7. +-commutative83.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+83.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-rr83.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 y around 0 75.3%

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

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

    if -1 < x < -6.99999999999999991e-151

    1. Initial program 83.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*90.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+90.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. Simplified90.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 y around 0 42.0%

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

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

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

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

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

    if -6.99999999999999991e-151 < x

    1. Initial program 66.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*79.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+79.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. Simplified79.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 57.6%

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

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

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

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

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

Alternative 15: 61.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-122}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -3.6e-122) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= -3.6e-122) {
		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 (x <= (-3.6d-122)) 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 (x <= -3.6e-122) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -3.6e-122:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -3.6e-122)
		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 (x <= -3.6e-122)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -3.6e-122], 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}\;x \leq -3.6 \cdot 10^{-122}:\\
\;\;\;\;\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 x < -3.59999999999999994e-122

    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*76.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+76.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. Simplified76.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 62.3%

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

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

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

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

    if -3.59999999999999994e-122 < x

    1. Initial program 67.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.2%

        \[\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.2%

        \[\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.2%

      \[\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 58.2%

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

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

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

      \[\leadsto x \cdot \color{blue}{\frac{\frac{1}{y}}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*r/60.0%

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

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y + 1} \]
    9. Applied egg-rr60.1%

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

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

Alternative 16: 34.1% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.36 \cdot 10^{-148}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 68.9%

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

        \[\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+78.4%

        \[\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. Simplified78.4%

      \[\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 57.4%

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

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

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

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

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

    if 1.36e-148 < y

    1. Initial program 66.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*78.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+78.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. Simplified78.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 55.8%

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

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

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

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

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

Alternative 17: 4.2% accurate, 5.7× speedup?

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

\\
\frac{1}{y}
\end{array}
Derivation
  1. Initial program 67.8%

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

      \[\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.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-frac92.1%

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

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

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

    \[\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 0 56.0%

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

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

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

      \[\leadsto \frac{\color{blue}{1 - \frac{1 + 2 \cdot x}{y}}}{y} \]
    3. *-commutative3.5%

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

    \[\leadsto \color{blue}{\frac{1 - \frac{1 + x \cdot 2}{y}}{y}} \]
  9. Taylor expanded in y around inf 4.0%

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

    \[\leadsto \frac{1}{y} \]
  11. Add Preprocessing

Alternative 18: 26.0% accurate, 5.7× speedup?

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

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 67.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*78.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+78.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. Simplified78.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 46.1%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  9. Final simplification25.7%

    \[\leadsto \frac{x}{y} \]
  10. Add Preprocessing

Alternative 19: 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 67.8%

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

      \[\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.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-frac92.1%

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

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

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

    \[\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 0 51.6%

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

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

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

    \[\leadsto \color{blue}{1} \]
  9. Final simplification3.3%

    \[\leadsto 1 \]
  10. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

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

  :alt
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

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