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

Percentage Accurate: 69.7% → 99.8%
Time: 19.8s
Alternatives: 21
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 21 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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
    11. +-commutative82.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    12. +-commutative82.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    13. cube-unmult82.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    14. +-commutative82.7%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified82.7%

    \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/65.8%

      \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    2. fma-udef47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 65.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{y + x}\\ \mathbf{if}\;x \leq -1.92 \cdot 10^{+149}:\\ \;\;\;\;\frac{t\_0}{y + x}\\ \mathbf{elif}\;x \leq -260000:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-19} \lor \neg \left(x \leq 6.4 \cdot 10^{-233}\right):\\ \;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_0}{\frac{1}{x}}}{y + x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ y (+ y x))))
   (if (<= x -1.92e+149)
     (/ t_0 (+ y x))
     (if (<= x -260000.0)
       (/ y (* (+ y x) (+ y x)))
       (if (or (<= x -5.8e-19) (not (<= x 6.4e-233)))
         (/ (/ x (+ y (+ x (+ x 1.0)))) (+ y x))
         (/ (/ t_0 (/ 1.0 x)) (+ y x)))))))
double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (x <= -1.92e+149) {
		tmp = t_0 / (y + x);
	} else if (x <= -260000.0) {
		tmp = y / ((y + x) * (y + x));
	} else if ((x <= -5.8e-19) || !(x <= 6.4e-233)) {
		tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
	} else {
		tmp = (t_0 / (1.0 / x)) / (y + x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = y / (y + x)
    if (x <= (-1.92d+149)) then
        tmp = t_0 / (y + x)
    else if (x <= (-260000.0d0)) then
        tmp = y / ((y + x) * (y + x))
    else if ((x <= (-5.8d-19)) .or. (.not. (x <= 6.4d-233))) then
        tmp = (x / (y + (x + (x + 1.0d0)))) / (y + x)
    else
        tmp = (t_0 / (1.0d0 / x)) / (y + x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = y / (y + x);
	double tmp;
	if (x <= -1.92e+149) {
		tmp = t_0 / (y + x);
	} else if (x <= -260000.0) {
		tmp = y / ((y + x) * (y + x));
	} else if ((x <= -5.8e-19) || !(x <= 6.4e-233)) {
		tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
	} else {
		tmp = (t_0 / (1.0 / x)) / (y + x);
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (y + x)
	tmp = 0
	if x <= -1.92e+149:
		tmp = t_0 / (y + x)
	elif x <= -260000.0:
		tmp = y / ((y + x) * (y + x))
	elif (x <= -5.8e-19) or not (x <= 6.4e-233):
		tmp = (x / (y + (x + (x + 1.0)))) / (y + x)
	else:
		tmp = (t_0 / (1.0 / x)) / (y + x)
	return tmp
function code(x, y)
	t_0 = Float64(y / Float64(y + x))
	tmp = 0.0
	if (x <= -1.92e+149)
		tmp = Float64(t_0 / Float64(y + x));
	elseif (x <= -260000.0)
		tmp = Float64(y / Float64(Float64(y + x) * Float64(y + x)));
	elseif ((x <= -5.8e-19) || !(x <= 6.4e-233))
		tmp = Float64(Float64(x / Float64(y + Float64(x + Float64(x + 1.0)))) / Float64(y + x));
	else
		tmp = Float64(Float64(t_0 / Float64(1.0 / x)) / Float64(y + x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = y / (y + x);
	tmp = 0.0;
	if (x <= -1.92e+149)
		tmp = t_0 / (y + x);
	elseif (x <= -260000.0)
		tmp = y / ((y + x) * (y + x));
	elseif ((x <= -5.8e-19) || ~((x <= 6.4e-233)))
		tmp = (x / (y + (x + (x + 1.0)))) / (y + x);
	else
		tmp = (t_0 / (1.0 / x)) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.92e+149], N[(t$95$0 / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -260000.0], N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5.8e-19], N[Not[LessEqual[x, 6.4e-233]], $MachinePrecision]], N[(N[(x / N[(y + N[(x + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -1.92 \cdot 10^{+149}:\\
\;\;\;\;\frac{t\_0}{y + x}\\

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

\mathbf{elif}\;x \leq -5.8 \cdot 10^{-19} \lor \neg \left(x \leq 6.4 \cdot 10^{-233}\right):\\
\;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified78.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef0.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.91999999999999996e149 < x < -2.6e5

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e5 < x < -5.8e-19 or 6.3999999999999997e-233 < x

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative82.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative82.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult82.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative82.5%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified82.5%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/65.3%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef59.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.8e-19 < x < 6.3999999999999997e-233

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative83.6%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative83.6%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult83.6%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative83.6%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified83.6%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/63.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef49.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.92 \cdot 10^{+149}:\\ \;\;\;\;\frac{\frac{y}{y + x}}{y + x}\\ \mathbf{elif}\;x \leq -260000:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -5.8 \cdot 10^{-19} \lor \neg \left(x \leq 6.4 \cdot 10^{-233}\right):\\ \;\;\;\;\frac{\frac{x}{y + \left(x + \left(x + 1\right)\right)}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{y}{y + x}}{\frac{1}{x}}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.3% accurate, 0.6× speedup?

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative85.3%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative85.3%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult85.3%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative85.3%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified85.3%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5e-305 < y < 1.9000000000000001e-161

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative60.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative60.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult60.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative60.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified60.8%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/39.6%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9000000000000001e-161 < y < 0.105999999999999997

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.105999999999999997 < y

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified75.4%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/63.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 84.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult84.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative84.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified84.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.2%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef43.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000006e-17 < y < 4.6e136

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.6e136 < y

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified75.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/57.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 83.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{y}{y + x}\\
\mathbf{if}\;x \leq -1.92 \cdot 10^{+149}:\\
\;\;\;\;\frac{t\_0}{y + x}\\

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative78.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified78.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef0.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.91999999999999996e149 < x < -1.8e5

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8e5 < x

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative82.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative82.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult82.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative82.9%

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{y + x}}{1} \cdot \frac{\frac{1}{\frac{y + 1}{x}}}{x + y}} \]
      4. /-rgt-identity79.3%

        \[\leadsto \color{blue}{\frac{y}{y + x}} \cdot \frac{\frac{1}{\frac{y + 1}{x}}}{x + y} \]
      5. clear-num79.4%

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{y + 1}}{\color{blue}{y + x}} \]
    13. Applied egg-rr79.4%

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

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

Alternative 6: 94.1% accurate, 0.8× speedup?

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

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

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


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

    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. associate-+r+66.9%

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

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

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

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

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

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

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

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

    if 4.6e136 < y

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative75.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified75.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/57.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult84.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative84.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified84.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef43.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.115000000000000005 < y

    1. Initial program 63.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative75.4%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified75.4%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/63.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef61.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 62.8% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative83.8%

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef41.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000004e-50 < y

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef63.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 44.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified81.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/62.1%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999997e-196 < y < 0.75

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.75 < y

    1. Initial program 63.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 44.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified81.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/62.1%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999997e-196 < y < 5.00000000000000024e25

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000024e25 < y

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 61.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000004e-50 < y < 5.6000000000000003e25

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6000000000000003e25 < y

    1. Initial program 59.8%

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

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

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

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative64.9%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/79.6%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative79.6%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/79.7%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg79.7%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative79.7%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative79.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg79.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative79.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+79.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified79.7%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 74.6%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{x}{y}} \]
    6. Taylor expanded in y around inf 71.2%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+25}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 61.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 1.04 \cdot 10^{+15}:\\ \;\;\;\;\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 (<= y 4.8e-50)
   (/ y (* x (+ x 1.0)))
   (if (<= y 1.04e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x)))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-50) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 1.04e+15) {
		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 (y <= 4.8d-50) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 1.04d+15) 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 (y <= 4.8e-50) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 1.04e+15) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.8e-50:
		tmp = y / (x * (x + 1.0))
	elif y <= 1.04e+15:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.8e-50)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 1.04e+15)
		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 (y <= 4.8e-50)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 1.04e+15)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.8e-50], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.04e+15], 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}\;y \leq 4.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{elif}\;y \leq 1.04 \cdot 10^{+15}:\\
\;\;\;\;\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 3 regimes
  2. if y < 4.80000000000000004e-50

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*67.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative67.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.5%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.5%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]

    if 4.80000000000000004e-50 < y < 1.04e15

    1. Initial program 88.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*89.0%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative89.0%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative89.0%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative89.0%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/99.4%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative99.4%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/99.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg99.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative99.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 48.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative48.1%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified48.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 1.04e15 < y

    1. Initial program 61.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac80.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative80.6%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative80.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative80.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac61.8%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/74.2%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative74.2%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in68.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def74.2%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult74.1%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative74.1%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified74.1%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/61.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef59.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult59.8%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times80.6%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in y around inf 72.9%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-50}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 1.04 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 62.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.95 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\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 (<= y 3.95e-50)
   (/ (/ y x) (+ x 1.0))
   (if (<= y 1.3e+15) (/ x (* y (+ y 1.0))) (/ (/ x y) (+ y x)))))
double code(double x, double y) {
	double tmp;
	if (y <= 3.95e-50) {
		tmp = (y / x) / (x + 1.0);
	} else if (y <= 1.3e+15) {
		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 (y <= 3.95d-50) then
        tmp = (y / x) / (x + 1.0d0)
    else if (y <= 1.3d+15) 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 (y <= 3.95e-50) {
		tmp = (y / x) / (x + 1.0);
	} else if (y <= 1.3e+15) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 3.95e-50:
		tmp = (y / x) / (x + 1.0)
	elif y <= 1.3e+15:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 3.95e-50)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	elseif (y <= 1.3e+15)
		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 (y <= 3.95e-50)
		tmp = (y / x) / (x + 1.0);
	elseif (y <= 1.3e+15)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 3.95e-50], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e+15], 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}\;y \leq 3.95 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\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 3 regimes
  2. if y < 3.9500000000000001e-50

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*67.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative67.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.5%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.5%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*61.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative61.1%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified61.1%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 3.9500000000000001e-50 < y < 1.3e15

    1. Initial program 88.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*89.0%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative89.0%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative89.0%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative89.0%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/99.4%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative99.4%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/99.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg99.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative99.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+99.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 48.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative48.1%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified48.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]

    if 1.3e15 < y

    1. Initial program 61.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac80.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative80.6%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative80.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative80.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac61.8%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/74.2%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative74.2%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in68.4%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def74.2%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative74.2%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult74.1%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative74.1%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified74.1%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/61.9%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef59.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult59.8%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative61.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times80.6%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in y around inf 72.9%

      \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{x + y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.95 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ y (+ y x)) (/ (/ x (+ y (+ x 1.0))) (+ y x))))
double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y / (y + x)) * ((x / (y + (x + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
def code(x, y):
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x))
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)))
end
function tmp = code(x, y)
	tmp = (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Derivation
  1. Initial program 65.8%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-+r+65.8%

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    2. *-commutative65.8%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
    3. frac-times86.0%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. associate-*l/78.1%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    5. times-frac99.8%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
    6. associate-+r+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
    7. +-commutative99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
    8. associate-+l+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
  4. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
  5. Final simplification99.8%

    \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \]
  6. Add Preprocessing

Alternative 15: 62.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 7.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 7.4e-53)
   (/ (/ y (+ x 1.0)) (+ y x))
   (* (/ x (+ x (+ y 1.0))) (/ 1.0 y))))
double code(double x, double y) {
	double tmp;
	if (y <= 7.4e-53) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else {
		tmp = (x / (x + (y + 1.0))) * (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 <= 7.4d-53) then
        tmp = (y / (x + 1.0d0)) / (y + x)
    else
        tmp = (x / (x + (y + 1.0d0))) * (1.0d0 / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 7.4e-53) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else {
		tmp = (x / (x + (y + 1.0))) * (1.0 / y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 7.4e-53:
		tmp = (y / (x + 1.0)) / (y + x)
	else:
		tmp = (x / (x + (y + 1.0))) * (1.0 / y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 7.4e-53)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x));
	else
		tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) * Float64(1.0 / y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 7.4e-53)
		tmp = (y / (x + 1.0)) / (y + x);
	else
		tmp = (x / (x + (y + 1.0))) * (1.0 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 7.4e-53], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 7.39999999999999965e-53

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative86.5%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative86.5%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative86.5%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac64.8%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/83.8%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative83.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in55.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def83.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified83.8%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef41.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult41.1%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in y around 0 61.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{x + y} \]
    8. Step-by-step derivation
      1. +-commutative61.6%

        \[\leadsto \frac{\frac{y}{\color{blue}{x + 1}}}{x + y} \]
    9. Simplified61.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]

    if 7.39999999999999965e-53 < y

    1. Initial program 67.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*71.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative71.7%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative71.7%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative71.7%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/84.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative84.8%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/84.9%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg84.9%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative84.9%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.9%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 67.3%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 7.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + \left(y + 1\right)} \cdot \frac{1}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 62.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 6.2e-50) (/ (/ y x) (+ x 1.0)) (* (/ x (+ y 1.0)) (/ 1.0 y))))
double code(double x, double y) {
	double tmp;
	if (y <= 6.2e-50) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + 1.0)) * (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 <= 6.2d-50) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = (x / (y + 1.0d0)) * (1.0d0 / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 6.2e-50) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + 1.0)) * (1.0 / y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 6.2e-50:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / (y + 1.0)) * (1.0 / y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 6.2e-50)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(Float64(x / Float64(y + 1.0)) * Float64(1.0 / y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 6.2e-50)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / (y + 1.0)) * (1.0 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 6.2e-50], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 6.2000000000000004e-50

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*67.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative67.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.5%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.5%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*61.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative61.1%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified61.1%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 6.2000000000000004e-50 < y

    1. Initial program 67.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*71.7%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative71.7%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative71.7%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative71.7%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/84.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative84.8%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/84.9%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg84.9%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative84.9%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+84.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.9%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 64.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative64.5%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified64.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Step-by-step derivation
      1. *-un-lft-identity64.5%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(y + 1\right)} \]
      2. times-frac66.9%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr66.9%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    10. Step-by-step derivation
      1. *-commutative66.9%

        \[\leadsto \color{blue}{\frac{x}{y + 1} \cdot \frac{1}{y}} \]
    11. Simplified66.9%

      \[\leadsto \color{blue}{\frac{x}{y + 1} \cdot \frac{1}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + 1} \cdot \frac{1}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 62.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.9 \cdot 10^{-51}:\\ \;\;\;\;\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 (<= y 4.9e-51) (/ (/ y x) (+ x 1.0)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.9e-51) {
		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 (y <= 4.9d-51) 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 (y <= 4.9e-51) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / (y + 1.0)) / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.9e-51:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / (y + 1.0)) / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.9e-51)
		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 (y <= 4.9e-51)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / (y + 1.0)) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.9e-51], 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}\;y \leq 4.9 \cdot 10^{-51}:\\
\;\;\;\;\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 y < 4.89999999999999974e-51

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*67.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative67.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative67.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.5%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.5%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.4%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.4%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.4%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.4%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*61.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative61.1%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified61.1%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 4.89999999999999974e-51 < y

    1. Initial program 67.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative84.9%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative84.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative84.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac67.9%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/79.9%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative79.9%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in72.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def79.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef63.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult63.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times84.9%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in x around 0 67.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{x + y} \]
    8. Step-by-step derivation
      1. +-commutative67.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{x + y} \]
    9. Simplified67.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{x + y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification63.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.9 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 62.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 3.5e-51) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
	double tmp;
	if (y <= 3.5e-51) {
		tmp = (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 (y <= 3.5d-51) then
        tmp = (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 (y <= 3.5e-51) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else {
		tmp = (x / (y + 1.0)) / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 3.5e-51:
		tmp = (y / (x + 1.0)) / (y + x)
	else:
		tmp = (x / (y + 1.0)) / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 3.5e-51)
		tmp = Float64(Float64(y / Float64(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 (y <= 3.5e-51)
		tmp = (y / (x + 1.0)) / (y + x);
	else
		tmp = (x / (y + 1.0)) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 3.5e-51], N[(N[(y / N[(x + 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}\;y \leq 3.5 \cdot 10^{-51}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.4999999999999997e-51

    1. Initial program 64.8%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative86.5%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative86.5%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative86.5%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac64.8%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/83.8%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative83.8%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in55.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def83.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative83.8%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified83.8%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef41.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult41.1%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative64.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times86.4%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in y around 0 61.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{x + y} \]
    8. Step-by-step derivation
      1. +-commutative61.6%

        \[\leadsto \frac{\frac{y}{\color{blue}{x + 1}}}{x + y} \]
    9. Simplified61.6%

      \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]

    if 3.4999999999999997e-51 < y

    1. Initial program 67.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative84.9%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative84.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative84.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac67.9%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/79.9%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative79.9%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in72.8%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def79.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/68.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef63.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult63.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative67.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times84.9%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in x around 0 67.3%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{x + y} \]
    8. Step-by-step derivation
      1. +-commutative67.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{x + y} \]
    9. Simplified67.3%

      \[\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}\;y \leq 3.5 \cdot 10^{-51}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 32.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5.6 \cdot 10^{-196}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 5.6e-196) (/ y (+ y x)) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (y <= 5.6e-196) {
		tmp = y / (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 <= 5.6d-196) then
        tmp = y / (y + x)
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 5.6e-196) {
		tmp = y / (y + x);
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5.6e-196:
		tmp = y / (y + x)
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5.6e-196)
		tmp = Float64(y / Float64(y + x));
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5.6e-196)
		tmp = y / (y + x);
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5.6e-196], N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.6 \cdot 10^{-196}:\\
\;\;\;\;\frac{y}{y + x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.5999999999999997e-196

    1. Initial program 62.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.2%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative85.2%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative85.2%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative85.2%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac62.1%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/81.9%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative81.9%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in53.2%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def81.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative81.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified81.9%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/62.1%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef38.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult38.9%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in62.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+62.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative62.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times85.1%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \color{blue}{\frac{1}{\frac{y + \left(x + 1\right)}{x}}}}{x + y} \]
      2. un-div-inv99.8%

        \[\leadsto \frac{\color{blue}{\frac{\frac{y}{x + y}}{\frac{y + \left(x + 1\right)}{x}}}}{x + y} \]
      3. +-commutative99.8%

        \[\leadsto \frac{\frac{\frac{y}{\color{blue}{y + x}}}{\frac{y + \left(x + 1\right)}{x}}}{x + y} \]
    8. Applied egg-rr99.8%

      \[\leadsto \frac{\color{blue}{\frac{\frac{y}{y + x}}{\frac{y + \left(x + 1\right)}{x}}}}{x + y} \]
    9. Taylor expanded in x around 0 75.0%

      \[\leadsto \frac{\frac{\frac{y}{y + x}}{\color{blue}{\frac{1 + y}{x}}}}{x + y} \]
    10. Step-by-step derivation
      1. +-commutative75.0%

        \[\leadsto \frac{\frac{\frac{y}{y + x}}{\frac{\color{blue}{y + 1}}{x}}}{x + y} \]
    11. Simplified75.0%

      \[\leadsto \frac{\frac{\frac{y}{y + x}}{\color{blue}{\frac{y + 1}{x}}}}{x + y} \]
    12. Taylor expanded in y around 0 34.7%

      \[\leadsto \frac{\color{blue}{y}}{x + y} \]

    if 5.5999999999999997e-196 < y

    1. Initial program 71.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-/r*73.8%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative73.8%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative73.8%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative73.8%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/87.2%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative87.2%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/87.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg87.3%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative87.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative87.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg87.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative87.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+87.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified87.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 54.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative54.3%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified54.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Taylor expanded in y around 0 33.7%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5.6 \cdot 10^{-196}:\\ \;\;\;\;\frac{y}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 26.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -9:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x -9.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (x <= -9.0) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-9.0d0)) then
        tmp = 1.0d0 / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -9.0) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -9.0:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -9.0)
		tmp = Float64(1.0 / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -9.0)
		tmp = 1.0 / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -9.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9:\\
\;\;\;\;\frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9

    1. Initial program 70.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*73.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative73.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative73.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative73.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/85.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative85.3%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/85.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg85.3%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative85.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative85.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg85.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative85.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+85.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified85.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 38.8%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{x}{y}} \]
    6. Taylor expanded in y around 0 5.8%

      \[\leadsto \color{blue}{\frac{1}{x}} \]

    if -9 < x

    1. Initial program 64.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-/r*66.8%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative66.8%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative66.8%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative66.8%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.2%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.2%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.2%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.2%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.2%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.2%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.2%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 57.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative57.7%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified57.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Taylor expanded in y around 0 33.3%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
	return 1.0 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
public static double code(double x, double y) {
	return 1.0 / x;
}
def code(x, y):
	return 1.0 / x
function code(x, y)
	return Float64(1.0 / x)
end
function tmp = code(x, y)
	tmp = 1.0 / x;
end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 65.8%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*68.5%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
    2. *-commutative68.5%

      \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    3. +-commutative68.5%

      \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    4. +-commutative68.5%

      \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
    5. associate-*l/86.0%

      \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
    6. +-commutative86.0%

      \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
    7. associate-*r/86.0%

      \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
    8. remove-double-neg86.0%

      \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
    9. +-commutative86.0%

      \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
    10. +-commutative86.0%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
    11. remove-double-neg86.0%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
    12. +-commutative86.0%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
    13. associate-+l+86.0%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified86.0%

    \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in y around inf 49.4%

    \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{x}{y}} \]
  6. Taylor expanded in y around 0 4.5%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  7. Final simplification4.5%

    \[\leadsto \frac{1}{x} \]
  8. 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 2024031 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))