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

Percentage Accurate: 68.7% → 99.7%
Time: 14.6s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 68.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{y}{\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)}} \]
    7. +-commutative64.2%

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num63.8%

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

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

      \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
    4. distribute-rgt1-in80.7%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity86.8%

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

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

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

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

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

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

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

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

Alternative 2: 69.8% accurate, 0.5× speedup?

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

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

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

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

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


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

    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-/l*83.2%

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative57.0%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num56.2%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in82.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity89.6%

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

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

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

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

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

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

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

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

    if -8.9999999999999996e-235 < y < 5.2000000000000002e-132

    1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000002e-132 < y < 4.6000000000000003e96

    1. Initial program 80.7%

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

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

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

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

    if 4.6000000000000003e96 < y

    1. Initial program 53.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.5% accurate, 0.6× speedup?

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

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

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

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

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


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

    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-/l*83.2%

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative57.0%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num56.2%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in82.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity89.6%

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

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

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

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

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

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

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

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

    if -1.00000000000000005e-230 < y < 3.00000000000000019e-133

    1. Initial program 64.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000019e-133 < y < 1.7e5

    1. Initial program 88.9%

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

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

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

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

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

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

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

    if 1.7e5 < y

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 68.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative59.1%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num58.5%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in81.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity87.0%

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

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

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

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

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

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

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

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

    if 5.60000000000000046e-171 < y < 1.7e5

    1. Initial program 83.0%

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

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

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

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

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

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

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

    if 1.7e5 < y

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.2% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 68.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative59.1%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num58.5%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in81.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity87.0%

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

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

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

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

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

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

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

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

    if 5.60000000000000046e-171 < y < 0.00350000000000000007

    1. Initial program 82.5%

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

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

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

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

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

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

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

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

    if 0.00350000000000000007 < y

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 59.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{elif}\;y \leq 175000:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.9499999999999999e-145 or 4.79999999999999986e-20 < y < 175000

    1. Initial program 70.1%

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

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

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

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

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

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

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

    if 2.9499999999999999e-145 < y < 4.79999999999999986e-20

    1. Initial program 80.1%

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

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

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

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

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

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

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

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

    if 175000 < y

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 87.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x}{y + x}\\
\mathbf{if}\;y \leq 160000:\\
\;\;\;\;\frac{\frac{1}{y + x} \cdot t\_0}{\frac{1 + x}{y}}\\

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


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

    1. Initial program 71.3%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative62.7%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num62.2%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in84.2%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity88.8%

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

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

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

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

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

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

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

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

    if 1.6e5 < y

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.0% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 68.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative59.1%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num58.5%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in81.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity87.0%

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

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

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

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

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

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

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

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

    if 5.60000000000000046e-171 < y < 1.3e5

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

    if 1.3e5 < y

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.7% accurate, 0.9× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{y}{\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)}} \]
    7. +-commutative64.2%

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num63.8%

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

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

      \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
    4. distribute-rgt1-in80.7%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity86.8%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 45.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative58.7%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cube-mult58.7%

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      2. distribute-rgt1-in82.0%

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999983e-145 < y < 3.8000000000000002e174

    1. Initial program 68.9%

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

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

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

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

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

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

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

    if 3.8000000000000002e174 < y

    1. Initial program 58.7%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 45.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative58.7%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cube-mult58.7%

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      2. distribute-rgt1-in82.0%

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

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

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

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

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

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

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

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

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

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

    if 2.9499999999999999e-145 < y < 1

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

    if 1 < y

    1. Initial program 57.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 99.7% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto x \cdot \frac{y}{\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)}} \]
    7. +-commutative64.2%

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

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

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

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

    \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-num63.8%

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

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

      \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
    4. distribute-rgt1-in80.7%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity86.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 60.4% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative58.7%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num58.1%

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

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

        \[\leadsto \frac{x}{\frac{\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)}}{y}} \]
      4. distribute-rgt1-in81.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{x + \left(y + 1\right)}{y}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity86.9%

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

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

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

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

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

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

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

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

    if 2.9499999999999999e-145 < y

    1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    11. Applied egg-rr63.2%

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

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

Alternative 14: 60.0% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative58.7%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cube-mult58.7%

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      2. distribute-rgt1-in82.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9499999999999999e-145 < y

    1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    11. Applied egg-rr63.2%

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

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

Alternative 15: 59.8% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

    if 2.9499999999999999e-145 < y

    1. Initial program 65.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    11. Applied egg-rr63.2%

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

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

Alternative 16: 34.6% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 71.8%

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      7. +-commutative48.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. cube-mult48.8%

        \[\leadsto x \cdot \frac{y}{\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)}} \]
      2. distribute-rgt1-in79.1%

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

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

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

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

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

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

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

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

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

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

    if -2.80000000000000011e-172 < x

    1. Initial program 65.1%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 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 34.8%

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

Alternative 17: 26.6% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  9. Add Preprocessing

Alternative 18: 4.2% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0.5}{x}} \]
  9. Add Preprocessing

Developer Target 1: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))

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