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

Percentage Accurate: 68.3% → 99.8%
Time: 16.1s
Alternatives: 23
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 23 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.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 70.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3800000000000001e-179 < y < 2.5000000000000001e-4

    1. Initial program 89.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. *-commutative89.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Step-by-step derivation
      1. fma-udef79.8%

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-4 < y

    1. Initial program 55.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 71.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3800000000000001e-179 < y < 1.6000000000000001e149

    1. Initial program 77.7%

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

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

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

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

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 63.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999996e-124 < y < 1.2999999999999999e-68

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

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

    if 1.2999999999999999e-68 < y < 4.0000000000000001e-54

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

    if 4.0000000000000001e-54 < y < 4.9999999999999998e-8

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative61.0%

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e-8 < y < 1.6000000000000001e149

    1. Initial program 62.8%

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

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

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

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

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

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative90.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+149}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \]

Alternative 5: 66.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 0.00025:\\
\;\;\;\;y \cdot t_0\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+149}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8e-126 < y < 2.5000000000000001e-4

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-4 < y < 1.6000000000000001e149

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.8 \cdot 10^{-126}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 0.00025:\\ \;\;\;\;y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+149}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{\left(y + 1\right) + x \cdot 2}\\ \end{array} \]

Alternative 6: 67.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e-125 < y < 4.8999999999999999e-26

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

    if 4.8999999999999999e-26 < y

    1. Initial program 58.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.2% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.4999999999999997e-127 < y < 1.6000000000000001e149

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

    if 1.6000000000000001e149 < y

    1. Initial program 52.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 53.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y} - x\\ t_1 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-203}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{-68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-54}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (/ x y) x)) (t_1 (/ y (* x x))))
   (if (<= y -7.4e-110)
     t_1
     (if (<= y 2.2e-203)
       (* y (/ 1.0 x))
       (if (<= y 4.5e-124)
         t_1
         (if (<= y 2.85e-68)
           t_0
           (if (<= y 2.6e-54) t_1 (if (<= y 0.75) t_0 (/ x (* y y))))))))))
double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -7.4e-110) {
		tmp = t_1;
	} else if (y <= 2.2e-203) {
		tmp = y * (1.0 / x);
	} else if (y <= 4.5e-124) {
		tmp = t_1;
	} else if (y <= 2.85e-68) {
		tmp = t_0;
	} else if (y <= 2.6e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x / y) - x
    t_1 = y / (x * x)
    if (y <= (-7.4d-110)) then
        tmp = t_1
    else if (y <= 2.2d-203) then
        tmp = y * (1.0d0 / x)
    else if (y <= 4.5d-124) then
        tmp = t_1
    else if (y <= 2.85d-68) then
        tmp = t_0
    else if (y <= 2.6d-54) then
        tmp = t_1
    else if (y <= 0.75d0) then
        tmp = t_0
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -7.4e-110) {
		tmp = t_1;
	} else if (y <= 2.2e-203) {
		tmp = y * (1.0 / x);
	} else if (y <= 4.5e-124) {
		tmp = t_1;
	} else if (y <= 2.85e-68) {
		tmp = t_0;
	} else if (y <= 2.6e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / y) - x
	t_1 = y / (x * x)
	tmp = 0
	if y <= -7.4e-110:
		tmp = t_1
	elif y <= 2.2e-203:
		tmp = y * (1.0 / x)
	elif y <= 4.5e-124:
		tmp = t_1
	elif y <= 2.85e-68:
		tmp = t_0
	elif y <= 2.6e-54:
		tmp = t_1
	elif y <= 0.75:
		tmp = t_0
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / y) - x)
	t_1 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -7.4e-110)
		tmp = t_1;
	elseif (y <= 2.2e-203)
		tmp = Float64(y * Float64(1.0 / x));
	elseif (y <= 4.5e-124)
		tmp = t_1;
	elseif (y <= 2.85e-68)
		tmp = t_0;
	elseif (y <= 2.6e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / y) - x;
	t_1 = y / (x * x);
	tmp = 0.0;
	if (y <= -7.4e-110)
		tmp = t_1;
	elseif (y <= 2.2e-203)
		tmp = y * (1.0 / x);
	elseif (y <= 4.5e-124)
		tmp = t_1;
	elseif (y <= 2.85e-68)
		tmp = t_0;
	elseif (y <= 2.6e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4e-110], t$95$1, If[LessEqual[y, 2.2e-203], N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-124], t$95$1, If[LessEqual[y, 2.85e-68], t$95$0, If[LessEqual[y, 2.6e-54], t$95$1, If[LessEqual[y, 0.75], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y} - x\\
t_1 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.85 \cdot 10^{-68}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-54}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.40000000000000032e-110 or 2.2e-203 < y < 4.4999999999999996e-124 or 2.8500000000000001e-68 < y < 2.60000000000000002e-54

    1. Initial program 81.3%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 40.5%

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified40.5%

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

    if -7.40000000000000032e-110 < y < 2.2e-203

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999996e-124 < y < 2.8500000000000001e-68 or 2.60000000000000002e-54 < y < 0.75

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified55.2%

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

    if 0.75 < y

    1. Initial program 55.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/71.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. *-commutative71.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. distribute-rgt1-in66.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 63.0%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified63.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{-110}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-203}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 9: 53.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y} - x\\ t_1 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -4.4 \cdot 10^{-105}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-203}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-54}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (/ x y) x)) (t_1 (/ y (* x x))))
   (if (<= y -4.4e-105)
     t_1
     (if (<= y 4.1e-203)
       (/ (- y) (- x))
       (if (<= y 4.2e-124)
         t_1
         (if (<= y 2.95e-68)
           t_0
           (if (<= y 2.45e-54) t_1 (if (<= y 0.75) t_0 (/ x (* y y))))))))))
double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -4.4e-105) {
		tmp = t_1;
	} else if (y <= 4.1e-203) {
		tmp = -y / -x;
	} else if (y <= 4.2e-124) {
		tmp = t_1;
	} else if (y <= 2.95e-68) {
		tmp = t_0;
	} else if (y <= 2.45e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x / y) - x
    t_1 = y / (x * x)
    if (y <= (-4.4d-105)) then
        tmp = t_1
    else if (y <= 4.1d-203) then
        tmp = -y / -x
    else if (y <= 4.2d-124) then
        tmp = t_1
    else if (y <= 2.95d-68) then
        tmp = t_0
    else if (y <= 2.45d-54) then
        tmp = t_1
    else if (y <= 0.75d0) then
        tmp = t_0
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -4.4e-105) {
		tmp = t_1;
	} else if (y <= 4.1e-203) {
		tmp = -y / -x;
	} else if (y <= 4.2e-124) {
		tmp = t_1;
	} else if (y <= 2.95e-68) {
		tmp = t_0;
	} else if (y <= 2.45e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / y) - x
	t_1 = y / (x * x)
	tmp = 0
	if y <= -4.4e-105:
		tmp = t_1
	elif y <= 4.1e-203:
		tmp = -y / -x
	elif y <= 4.2e-124:
		tmp = t_1
	elif y <= 2.95e-68:
		tmp = t_0
	elif y <= 2.45e-54:
		tmp = t_1
	elif y <= 0.75:
		tmp = t_0
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / y) - x)
	t_1 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -4.4e-105)
		tmp = t_1;
	elseif (y <= 4.1e-203)
		tmp = Float64(Float64(-y) / Float64(-x));
	elseif (y <= 4.2e-124)
		tmp = t_1;
	elseif (y <= 2.95e-68)
		tmp = t_0;
	elseif (y <= 2.45e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / y) - x;
	t_1 = y / (x * x);
	tmp = 0.0;
	if (y <= -4.4e-105)
		tmp = t_1;
	elseif (y <= 4.1e-203)
		tmp = -y / -x;
	elseif (y <= 4.2e-124)
		tmp = t_1;
	elseif (y <= 2.95e-68)
		tmp = t_0;
	elseif (y <= 2.45e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e-105], t$95$1, If[LessEqual[y, 4.1e-203], N[((-y) / (-x)), $MachinePrecision], If[LessEqual[y, 4.2e-124], t$95$1, If[LessEqual[y, 2.95e-68], t$95$0, If[LessEqual[y, 2.45e-54], t$95$1, If[LessEqual[y, 0.75], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y} - x\\
t_1 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{-105}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-203}:\\
\;\;\;\;\frac{-y}{-x}\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-124}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.95 \cdot 10^{-68}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 2.45 \cdot 10^{-54}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.40000000000000008e-105 or 4.09999999999999981e-203 < y < 4.2000000000000002e-124 or 2.95e-68 < y < 2.4500000000000001e-54

    1. Initial program 81.1%

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

        \[\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. distribute-rgt1-in51.7%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 39.8%

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified39.8%

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

    if -4.40000000000000008e-105 < y < 4.09999999999999981e-203

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-x}} \]
    10. Applied egg-rr80.3%

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

    if 4.2000000000000002e-124 < y < 2.95e-68 or 2.4500000000000001e-54 < y < 0.75

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified55.2%

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

    if 0.75 < y

    1. Initial program 55.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/71.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. *-commutative71.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. distribute-rgt1-in66.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 63.0%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified63.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.4 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-203}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 10: 53.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y} - x\\ t_1 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -3.9 \cdot 10^{-101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-205}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-54}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- (/ x y) x)) (t_1 (/ y (* x x))))
   (if (<= y -3.9e-101)
     t_1
     (if (<= y 1.85e-205)
       (/ (- y) (- x))
       (if (<= y 4.5e-124)
         t_1
         (if (<= y 1.45e-68)
           t_0
           (if (<= y 3.4e-54) t_1 (if (<= y 0.75) t_0 (/ (/ x y) y)))))))))
double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -3.9e-101) {
		tmp = t_1;
	} else if (y <= 1.85e-205) {
		tmp = -y / -x;
	} else if (y <= 4.5e-124) {
		tmp = t_1;
	} else if (y <= 1.45e-68) {
		tmp = t_0;
	} else if (y <= 3.4e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (x / y) - x
    t_1 = y / (x * x)
    if (y <= (-3.9d-101)) then
        tmp = t_1
    else if (y <= 1.85d-205) then
        tmp = -y / -x
    else if (y <= 4.5d-124) then
        tmp = t_1
    else if (y <= 1.45d-68) then
        tmp = t_0
    else if (y <= 3.4d-54) then
        tmp = t_1
    else if (y <= 0.75d0) then
        tmp = t_0
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (x / y) - x;
	double t_1 = y / (x * x);
	double tmp;
	if (y <= -3.9e-101) {
		tmp = t_1;
	} else if (y <= 1.85e-205) {
		tmp = -y / -x;
	} else if (y <= 4.5e-124) {
		tmp = t_1;
	} else if (y <= 1.45e-68) {
		tmp = t_0;
	} else if (y <= 3.4e-54) {
		tmp = t_1;
	} else if (y <= 0.75) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = (x / y) - x
	t_1 = y / (x * x)
	tmp = 0
	if y <= -3.9e-101:
		tmp = t_1
	elif y <= 1.85e-205:
		tmp = -y / -x
	elif y <= 4.5e-124:
		tmp = t_1
	elif y <= 1.45e-68:
		tmp = t_0
	elif y <= 3.4e-54:
		tmp = t_1
	elif y <= 0.75:
		tmp = t_0
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	t_0 = Float64(Float64(x / y) - x)
	t_1 = Float64(y / Float64(x * x))
	tmp = 0.0
	if (y <= -3.9e-101)
		tmp = t_1;
	elseif (y <= 1.85e-205)
		tmp = Float64(Float64(-y) / Float64(-x));
	elseif (y <= 4.5e-124)
		tmp = t_1;
	elseif (y <= 1.45e-68)
		tmp = t_0;
	elseif (y <= 3.4e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (x / y) - x;
	t_1 = y / (x * x);
	tmp = 0.0;
	if (y <= -3.9e-101)
		tmp = t_1;
	elseif (y <= 1.85e-205)
		tmp = -y / -x;
	elseif (y <= 4.5e-124)
		tmp = t_1;
	elseif (y <= 1.45e-68)
		tmp = t_0;
	elseif (y <= 3.4e-54)
		tmp = t_1;
	elseif (y <= 0.75)
		tmp = t_0;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$1 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.9e-101], t$95$1, If[LessEqual[y, 1.85e-205], N[((-y) / (-x)), $MachinePrecision], If[LessEqual[y, 4.5e-124], t$95$1, If[LessEqual[y, 1.45e-68], t$95$0, If[LessEqual[y, 3.4e-54], t$95$1, If[LessEqual[y, 0.75], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{y} - x\\
t_1 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -3.9 \cdot 10^{-101}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.85 \cdot 10^{-205}:\\
\;\;\;\;\frac{-y}{-x}\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{-68}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-54}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.90000000000000015e-101 or 1.85e-205 < y < 4.4999999999999996e-124 or 1.45e-68 < y < 3.39999999999999987e-54

    1. Initial program 81.1%

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

        \[\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. distribute-rgt1-in51.7%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 39.8%

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
    6. Simplified39.8%

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

    if -3.90000000000000015e-101 < y < 1.85e-205

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-x}} \]
    10. Applied egg-rr80.3%

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

    if 4.4999999999999996e-124 < y < 1.45e-68 or 3.39999999999999987e-54 < y < 0.75

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified55.2%

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

    if 0.75 < y

    1. Initial program 55.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/71.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. *-commutative71.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. distribute-rgt1-in66.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 63.0%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified63.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity63.0%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot y} \]
      2. times-frac75.4%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    8. Applied egg-rr75.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{-101}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.85 \cdot 10^{-205}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 11: 54.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x} \cdot \frac{1}{x}\\ t_1 := \frac{x}{y} - x\\ \mathbf{if}\;y \leq -7.6 \cdot 10^{-106}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-204}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (* (/ y x) (/ 1.0 x))) (t_1 (- (/ x y) x)))
   (if (<= y -7.6e-106)
     t_0
     (if (<= y 1.75e-204)
       (/ (- y) (- x))
       (if (<= y 4.5e-124)
         t_0
         (if (<= y 1.3e-68)
           t_1
           (if (<= y 2.05e-54)
             (/ y (* x x))
             (if (<= y 0.75) t_1 (/ (/ x y) y)))))))))
double code(double x, double y) {
	double t_0 = (y / x) * (1.0 / x);
	double t_1 = (x / y) - x;
	double tmp;
	if (y <= -7.6e-106) {
		tmp = t_0;
	} else if (y <= 1.75e-204) {
		tmp = -y / -x;
	} else if (y <= 4.5e-124) {
		tmp = t_0;
	} else if (y <= 1.3e-68) {
		tmp = t_1;
	} else if (y <= 2.05e-54) {
		tmp = y / (x * x);
	} else if (y <= 0.75) {
		tmp = t_1;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (y / x) * (1.0d0 / x)
    t_1 = (x / y) - x
    if (y <= (-7.6d-106)) then
        tmp = t_0
    else if (y <= 1.75d-204) then
        tmp = -y / -x
    else if (y <= 4.5d-124) then
        tmp = t_0
    else if (y <= 1.3d-68) then
        tmp = t_1
    else if (y <= 2.05d-54) then
        tmp = y / (x * x)
    else if (y <= 0.75d0) then
        tmp = t_1
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = (y / x) * (1.0 / x);
	double t_1 = (x / y) - x;
	double tmp;
	if (y <= -7.6e-106) {
		tmp = t_0;
	} else if (y <= 1.75e-204) {
		tmp = -y / -x;
	} else if (y <= 4.5e-124) {
		tmp = t_0;
	} else if (y <= 1.3e-68) {
		tmp = t_1;
	} else if (y <= 2.05e-54) {
		tmp = y / (x * x);
	} else if (y <= 0.75) {
		tmp = t_1;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = (y / x) * (1.0 / x)
	t_1 = (x / y) - x
	tmp = 0
	if y <= -7.6e-106:
		tmp = t_0
	elif y <= 1.75e-204:
		tmp = -y / -x
	elif y <= 4.5e-124:
		tmp = t_0
	elif y <= 1.3e-68:
		tmp = t_1
	elif y <= 2.05e-54:
		tmp = y / (x * x)
	elif y <= 0.75:
		tmp = t_1
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	t_0 = Float64(Float64(y / x) * Float64(1.0 / x))
	t_1 = Float64(Float64(x / y) - x)
	tmp = 0.0
	if (y <= -7.6e-106)
		tmp = t_0;
	elseif (y <= 1.75e-204)
		tmp = Float64(Float64(-y) / Float64(-x));
	elseif (y <= 4.5e-124)
		tmp = t_0;
	elseif (y <= 1.3e-68)
		tmp = t_1;
	elseif (y <= 2.05e-54)
		tmp = Float64(y / Float64(x * x));
	elseif (y <= 0.75)
		tmp = t_1;
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = (y / x) * (1.0 / x);
	t_1 = (x / y) - x;
	tmp = 0.0;
	if (y <= -7.6e-106)
		tmp = t_0;
	elseif (y <= 1.75e-204)
		tmp = -y / -x;
	elseif (y <= 4.5e-124)
		tmp = t_0;
	elseif (y <= 1.3e-68)
		tmp = t_1;
	elseif (y <= 2.05e-54)
		tmp = y / (x * x);
	elseif (y <= 0.75)
		tmp = t_1;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / x), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[y, -7.6e-106], t$95$0, If[LessEqual[y, 1.75e-204], N[((-y) / (-x)), $MachinePrecision], If[LessEqual[y, 4.5e-124], t$95$0, If[LessEqual[y, 1.3e-68], t$95$1, If[LessEqual[y, 2.05e-54], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.75], t$95$1, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y}{x} \cdot \frac{1}{x}\\
t_1 := \frac{x}{y} - x\\
\mathbf{if}\;y \leq -7.6 \cdot 10^{-106}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.75 \cdot 10^{-204}:\\
\;\;\;\;\frac{-y}{-x}\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{x \cdot x}\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -7.5999999999999999e-106 or 1.75000000000000013e-204 < y < 4.4999999999999996e-124

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

    if -7.5999999999999999e-106 < y < 1.75000000000000013e-204

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-y}{-x}} \]
    10. Applied egg-rr80.3%

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

    if 4.4999999999999996e-124 < y < 1.2999999999999999e-68 or 2.05e-54 < y < 0.75

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified55.2%

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

    if 1.2999999999999999e-68 < y < 2.05e-54

    1. Initial program 99.7%

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

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

        \[\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. distribute-rgt1-in49.7%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 83.6%

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

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

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

    if 0.75 < y

    1. Initial program 55.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/71.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. *-commutative71.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. distribute-rgt1-in66.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 63.0%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified63.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity63.0%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot y} \]
      2. times-frac75.4%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    8. Applied egg-rr75.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 1.75 \cdot 10^{-204}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 12: 60.1% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq -2.35 \cdot 10^{-42}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 9.5 \cdot 10^{-27}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 66.0%

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in x around inf 77.1%

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

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

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

    if -1.8e11 < x < -2.35e-42 or -4.0000000000000003e-130 < x < 9.50000000000000037e-27

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

    if -2.35e-42 < x < -4.0000000000000003e-130

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{y}}{x} \]
      3. frac-2neg47.7%

        \[\leadsto \color{blue}{\frac{-y}{-x}} \]
    10. Applied egg-rr47.7%

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

    if 9.50000000000000037e-27 < x

    1. Initial program 70.8%

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

        \[\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. distribute-rgt1-in71.9%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 21.3%

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

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified21.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity21.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot y} \]
      2. times-frac23.4%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    8. Applied egg-rr23.4%

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

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y}}{y}} \]
      2. *-lft-identity23.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -180000000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -2.35 \cdot 10^{-42}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{elif}\;x \leq -4 \cdot 10^{-130}:\\ \;\;\;\;\frac{-y}{-x}\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 13: 60.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-44}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 10^{+16}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 3.29999999999999984e-124 or 1.3500000000000001e-68 < y < 5.1999999999999996e-44

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

    if 3.29999999999999984e-124 < y < 1.3500000000000001e-68

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

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

    if 5.1999999999999996e-44 < y < 1e16

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

    if 1e16 < y

    1. Initial program 54.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/70.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. *-commutative70.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. distribute-rgt1-in65.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 62.6%

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity62.6%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot y} \]
      2. times-frac75.4%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    8. Applied egg-rr75.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.3 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 10^{+16}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 14: 60.5% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

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

\mathbf{elif}\;y \leq 2 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999996e-124 < y < 1.2999999999999999e-68

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

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

    if 1.2999999999999999e-68 < y < 6.9999999999999995e-44

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

    if 6.9999999999999995e-44 < y < 2e17

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

    if 2e17 < y

    1. Initial program 54.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/70.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. *-commutative70.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. distribute-rgt1-in65.6%

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

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

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 62.6%

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

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

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
    7. Step-by-step derivation
      1. *-un-lft-identity62.6%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot y} \]
      2. times-frac75.4%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    8. Applied egg-rr75.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 15: 60.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq 6.1 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4999999999999996e-124 < y < 6.1e-68

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

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

    if 6.1e-68 < y < 3.8000000000000001e-44

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

    if 3.8000000000000001e-44 < y < 4.5e15

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

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

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

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

    if 4.5e15 < y

    1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      9. +-commutative76.4%

        \[\leadsto \frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \color{blue}{\left(x + y\right)}} \]
    8. Applied egg-rr76.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \left(x + y\right)}} \]
    9. Taylor expanded in y around inf 75.9%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x + x \cdot x}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \]

Alternative 16: 61.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.5e-124)
   (* (/ 1.0 x) (/ y (+ x 1.0)))
   (if (<= y 1.3e-68)
     (- (/ x y) x)
     (if (<= y 5e-44)
       (/ y (* x (+ x 1.0)))
       (if (<= y 2.7e+15) (/ x (+ y (* y y))) (/ (/ x (+ x y)) y))))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (1.0 / x) * (y / (x + 1.0));
	} else if (y <= 1.3e-68) {
		tmp = (x / y) - x;
	} else if (y <= 5e-44) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 2.7e+15) {
		tmp = x / (y + (y * y));
	} else {
		tmp = (x / (x + y)) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.5d-124) then
        tmp = (1.0d0 / x) * (y / (x + 1.0d0))
    else if (y <= 1.3d-68) then
        tmp = (x / y) - x
    else if (y <= 5d-44) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 2.7d+15) then
        tmp = x / (y + (y * y))
    else
        tmp = (x / (x + y)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (1.0 / x) * (y / (x + 1.0));
	} else if (y <= 1.3e-68) {
		tmp = (x / y) - x;
	} else if (y <= 5e-44) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 2.7e+15) {
		tmp = x / (y + (y * y));
	} else {
		tmp = (x / (x + y)) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.5e-124:
		tmp = (1.0 / x) * (y / (x + 1.0))
	elif y <= 1.3e-68:
		tmp = (x / y) - x
	elif y <= 5e-44:
		tmp = y / (x * (x + 1.0))
	elif y <= 2.7e+15:
		tmp = x / (y + (y * y))
	else:
		tmp = (x / (x + y)) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.5e-124)
		tmp = Float64(Float64(1.0 / x) * Float64(y / Float64(x + 1.0)));
	elseif (y <= 1.3e-68)
		tmp = Float64(Float64(x / y) - x);
	elseif (y <= 5e-44)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 2.7e+15)
		tmp = Float64(x / Float64(y + Float64(y * y)));
	else
		tmp = Float64(Float64(x / Float64(x + y)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.5e-124)
		tmp = (1.0 / x) * (y / (x + 1.0));
	elseif (y <= 1.3e-68)
		tmp = (x / y) - x;
	elseif (y <= 5e-44)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 2.7e+15)
		tmp = x / (y + (y * y));
	else
		tmp = (x / (x + y)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.5e-124], N[(N[(1.0 / x), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-68], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 5e-44], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+15], N[(x / N[(y + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{+15}:\\
\;\;\;\;\frac{x}{y + y \cdot y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around inf 65.7%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{y}{x + \left(y + 1\right)} \]
    5. Taylor expanded in y around 0 65.4%

      \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{y}{1 + x}} \]
    6. Step-by-step derivation
      1. +-commutative65.4%

        \[\leadsto \frac{1}{x} \cdot \frac{y}{\color{blue}{x + 1}} \]
    7. Simplified65.4%

      \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{y}{x + 1}} \]

    if 4.4999999999999996e-124 < y < 1.2999999999999999e-68

    1. Initial program 47.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in83.6%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity83.6%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]
    7. Taylor expanded in y around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-183.6%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg83.6%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 1.2999999999999999e-68 < y < 5.00000000000000039e-44

    1. Initial program 97.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 76.5%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

    if 5.00000000000000039e-44 < y < 2.7e15

    1. Initial program 93.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.4%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.4%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 60.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in60.7%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity60.7%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified60.7%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]

    if 2.7e15 < y

    1. Initial program 54.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac79.0%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity79.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/79.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity79.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+79.0%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 71.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative71.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified71.6%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Step-by-step derivation
      1. *-commutative71.6%

        \[\leadsto \color{blue}{\frac{y}{y + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      2. clear-num71.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
      3. associate-/r*76.4%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
      4. +-commutative76.4%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative76.4%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \]
      6. frac-times76.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + x}}{\frac{y + 1}{y} \cdot \left(y + x\right)}} \]
      7. *-un-lft-identity76.4%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      8. +-commutative76.4%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      9. +-commutative76.4%

        \[\leadsto \frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \color{blue}{\left(x + y\right)}} \]
    8. Applied egg-rr76.4%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \left(x + y\right)}} \]
    9. Taylor expanded in y around inf 75.9%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification68.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-44}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{+15}:\\ \;\;\;\;\frac{x}{y + y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \]

Alternative 17: 61.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.5e-124)
   (* (/ 1.0 x) (/ y (+ x 1.0)))
   (if (<= y 1.55e-68)
     (- (/ x y) x)
     (if (<= y 3.5e-54) (/ y (* x (+ x 1.0))) (/ (/ x (+ x y)) (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (1.0 / x) * (y / (x + 1.0));
	} else if (y <= 1.55e-68) {
		tmp = (x / y) - x;
	} else if (y <= 3.5e-54) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.5d-124) then
        tmp = (1.0d0 / x) * (y / (x + 1.0d0))
    else if (y <= 1.55d-68) then
        tmp = (x / y) - x
    else if (y <= 3.5d-54) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (1.0 / x) * (y / (x + 1.0));
	} else if (y <= 1.55e-68) {
		tmp = (x / y) - x;
	} else if (y <= 3.5e-54) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.5e-124:
		tmp = (1.0 / x) * (y / (x + 1.0))
	elif y <= 1.55e-68:
		tmp = (x / y) - x
	elif y <= 3.5e-54:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.5e-124)
		tmp = Float64(Float64(1.0 / x) * Float64(y / Float64(x + 1.0)));
	elseif (y <= 1.55e-68)
		tmp = Float64(Float64(x / y) - x);
	elseif (y <= 3.5e-54)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.5e-124)
		tmp = (1.0 / x) * (y / (x + 1.0));
	elseif (y <= 1.55e-68)
		tmp = (x / y) - x;
	elseif (y <= 3.5e-54)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.5e-124], N[(N[(1.0 / x), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.55e-68], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 3.5e-54], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\

\mathbf{elif}\;y \leq 1.55 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around inf 65.7%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{y}{x + \left(y + 1\right)} \]
    5. Taylor expanded in y around 0 65.4%

      \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{y}{1 + x}} \]
    6. Step-by-step derivation
      1. +-commutative65.4%

        \[\leadsto \frac{1}{x} \cdot \frac{y}{\color{blue}{x + 1}} \]
    7. Simplified65.4%

      \[\leadsto \frac{1}{x} \cdot \color{blue}{\frac{y}{x + 1}} \]

    if 4.4999999999999996e-124 < y < 1.55e-68

    1. Initial program 47.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in83.6%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity83.6%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]
    7. Taylor expanded in y around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-183.6%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg83.6%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 1.55e-68 < y < 3.49999999999999982e-54

    1. Initial program 99.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 85.2%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

    if 3.49999999999999982e-54 < y

    1. Initial program 64.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.1%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 75.2%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative75.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified75.2%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Step-by-step derivation
      1. *-commutative75.2%

        \[\leadsto \color{blue}{\frac{y}{y + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      2. clear-num75.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
      3. associate-/r*73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
      4. +-commutative73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \]
      6. frac-times73.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + x}}{\frac{y + 1}{y} \cdot \left(y + x\right)}} \]
      7. *-un-lft-identity73.3%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      8. +-commutative73.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      9. +-commutative73.3%

        \[\leadsto \frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \color{blue}{\left(x + y\right)}} \]
    8. Applied egg-rr73.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \left(x + y\right)}} \]
    9. Taylor expanded in x around 0 70.5%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{1 + y}} \]
    10. Step-by-step derivation
      1. +-commutative70.5%

        \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y + 1}} \]
    11. Simplified70.5%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y + 1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x + 1}\\ \mathbf{elif}\;y \leq 1.55 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \]

Alternative 18: 61.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.5e-124)
   (/ (/ y x) (+ x (+ y 1.0)))
   (if (<= y 1.3e-68)
     (- (/ x y) x)
     (if (<= y 3.5e-54) (/ y (* x (+ x 1.0))) (/ (/ x (+ x y)) (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (y / x) / (x + (y + 1.0));
	} else if (y <= 1.3e-68) {
		tmp = (x / y) - x;
	} else if (y <= 3.5e-54) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.5d-124) then
        tmp = (y / x) / (x + (y + 1.0d0))
    else if (y <= 1.3d-68) then
        tmp = (x / y) - x
    else if (y <= 3.5d-54) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / (x + y)) / (y + 1.0d0)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.5e-124) {
		tmp = (y / x) / (x + (y + 1.0));
	} else if (y <= 1.3e-68) {
		tmp = (x / y) - x;
	} else if (y <= 3.5e-54) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (x + y)) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.5e-124:
		tmp = (y / x) / (x + (y + 1.0))
	elif y <= 1.3e-68:
		tmp = (x / y) - x
	elif y <= 3.5e-54:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / (x + y)) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.5e-124)
		tmp = Float64(Float64(y / x) / Float64(x + Float64(y + 1.0)));
	elseif (y <= 1.3e-68)
		tmp = Float64(Float64(x / y) - x);
	elseif (y <= 3.5e-54)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(x + y)) / Float64(y + 1.0));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.5e-124)
		tmp = (y / x) / (x + (y + 1.0));
	elseif (y <= 1.3e-68)
		tmp = (x / y) - x;
	elseif (y <= 3.5e-54)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / (x + y)) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.5e-124], N[(N[(y / x), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3e-68], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], If[LessEqual[y, 3.5e-54], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 4.4999999999999996e-124

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around inf 65.7%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{y}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u65.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\right)\right)} \]
      2. expm1-udef40.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\right)} - 1} \]
      3. frac-times40.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot y}{x \cdot \left(x + \left(y + 1\right)\right)}}\right)} - 1 \]
      4. *-un-lft-identity40.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{y}}{x \cdot \left(x + \left(y + 1\right)\right)}\right)} - 1 \]
    6. Applied egg-rr40.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def65.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\right)\right)} \]
      2. expm1-log1p65.5%

        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}} \]
      3. associate-/r*65.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + \left(y + 1\right)}} \]
    8. Simplified65.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + \left(y + 1\right)}} \]

    if 4.4999999999999996e-124 < y < 1.2999999999999999e-68

    1. Initial program 47.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in83.6%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity83.6%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]
    7. Taylor expanded in y around 0 83.6%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-183.6%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg83.6%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified83.6%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 1.2999999999999999e-68 < y < 3.49999999999999982e-54

    1. Initial program 99.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around 0 85.2%

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

    if 3.49999999999999982e-54 < y

    1. Initial program 64.0%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac84.1%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+84.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified84.1%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 75.2%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative75.2%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified75.2%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Step-by-step derivation
      1. *-commutative75.2%

        \[\leadsto \color{blue}{\frac{y}{y + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      2. clear-num75.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
      3. associate-/r*73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
      4. +-commutative73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative73.3%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \]
      6. frac-times73.3%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + x}}{\frac{y + 1}{y} \cdot \left(y + x\right)}} \]
      7. *-un-lft-identity73.3%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      8. +-commutative73.3%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      9. +-commutative73.3%

        \[\leadsto \frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \color{blue}{\left(x + y\right)}} \]
    8. Applied egg-rr73.3%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \left(x + y\right)}} \]
    9. Taylor expanded in x around 0 70.5%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{1 + y}} \]
    10. Step-by-step derivation
      1. +-commutative70.5%

        \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y + 1}} \]
    11. Simplified70.5%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y + 1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification68.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.5 \cdot 10^{-124}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-68}:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y + 1}\\ \end{array} \]

Alternative 19: 66.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{if}\;y \leq 6 \cdot 10^{-127}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 0.00025:\\ \;\;\;\;y \cdot t_0\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+148}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ x (* (+ x y) (+ x y)))))
   (if (<= y 6e-127)
     (/ (/ y x) (+ x (+ y 1.0)))
     (if (<= y 0.00025)
       (* y t_0)
       (if (<= y 1.15e+148) t_0 (/ (/ x (+ x y)) y))))))
double code(double x, double y) {
	double t_0 = x / ((x + y) * (x + y));
	double tmp;
	if (y <= 6e-127) {
		tmp = (y / x) / (x + (y + 1.0));
	} else if (y <= 0.00025) {
		tmp = y * t_0;
	} else if (y <= 1.15e+148) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / 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 / ((x + y) * (x + y))
    if (y <= 6d-127) then
        tmp = (y / x) / (x + (y + 1.0d0))
    else if (y <= 0.00025d0) then
        tmp = y * t_0
    else if (y <= 1.15d+148) then
        tmp = t_0
    else
        tmp = (x / (x + y)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = x / ((x + y) * (x + y));
	double tmp;
	if (y <= 6e-127) {
		tmp = (y / x) / (x + (y + 1.0));
	} else if (y <= 0.00025) {
		tmp = y * t_0;
	} else if (y <= 1.15e+148) {
		tmp = t_0;
	} else {
		tmp = (x / (x + y)) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = x / ((x + y) * (x + y))
	tmp = 0
	if y <= 6e-127:
		tmp = (y / x) / (x + (y + 1.0))
	elif y <= 0.00025:
		tmp = y * t_0
	elif y <= 1.15e+148:
		tmp = t_0
	else:
		tmp = (x / (x + y)) / y
	return tmp
function code(x, y)
	t_0 = Float64(x / Float64(Float64(x + y) * Float64(x + y)))
	tmp = 0.0
	if (y <= 6e-127)
		tmp = Float64(Float64(y / x) / Float64(x + Float64(y + 1.0)));
	elseif (y <= 0.00025)
		tmp = Float64(y * t_0);
	elseif (y <= 1.15e+148)
		tmp = t_0;
	else
		tmp = Float64(Float64(x / Float64(x + y)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = x / ((x + y) * (x + y));
	tmp = 0.0;
	if (y <= 6e-127)
		tmp = (y / x) / (x + (y + 1.0));
	elseif (y <= 0.00025)
		tmp = y * t_0;
	elseif (y <= 1.15e+148)
		tmp = t_0;
	else
		tmp = (x / (x + y)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6e-127], N[(N[(y / x), $MachinePrecision] / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.00025], N[(y * t$95$0), $MachinePrecision], If[LessEqual[y, 1.15e+148], t$95$0, N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\
\mathbf{if}\;y \leq 6 \cdot 10^{-127}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\

\mathbf{elif}\;y \leq 0.00025:\\
\;\;\;\;y \cdot t_0\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+148}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 6.00000000000000017e-127

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around inf 65.7%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{y}{x + \left(y + 1\right)} \]
    5. Step-by-step derivation
      1. expm1-log1p-u65.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\right)\right)} \]
      2. expm1-udef40.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{x} \cdot \frac{y}{x + \left(y + 1\right)}\right)} - 1} \]
      3. frac-times40.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot y}{x \cdot \left(x + \left(y + 1\right)\right)}}\right)} - 1 \]
      4. *-un-lft-identity40.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{y}}{x \cdot \left(x + \left(y + 1\right)\right)}\right)} - 1 \]
    6. Applied egg-rr40.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def65.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}\right)\right)} \]
      2. expm1-log1p65.5%

        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + \left(y + 1\right)\right)}} \]
      3. associate-/r*65.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + \left(y + 1\right)}} \]
    8. Simplified65.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + \left(y + 1\right)}} \]

    if 6.00000000000000017e-127 < y < 2.5000000000000001e-4

    1. Initial program 85.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 90.4%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative90.4%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified90.4%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Taylor expanded in y around 0 87.2%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{y} \]

    if 2.5000000000000001e-4 < y < 1.15e148

    1. Initial program 60.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac95.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity95.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/95.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity95.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+95.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified95.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in y around inf 76.4%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{1} \]

    if 1.15e148 < y

    1. Initial program 52.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac68.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity68.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/68.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity68.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+68.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified68.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 68.5%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative68.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified68.5%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Step-by-step derivation
      1. *-commutative68.5%

        \[\leadsto \color{blue}{\frac{y}{y + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
      2. clear-num68.5%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{y}}} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \]
      3. associate-/r*90.0%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
      4. +-commutative90.0%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \]
      5. +-commutative90.0%

        \[\leadsto \frac{1}{\frac{y + 1}{y}} \cdot \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \]
      6. frac-times90.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + x}}{\frac{y + 1}{y} \cdot \left(y + x\right)}} \]
      7. *-un-lft-identity90.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      8. +-commutative90.0%

        \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{\frac{y + 1}{y} \cdot \left(y + x\right)} \]
      9. +-commutative90.0%

        \[\leadsto \frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \color{blue}{\left(x + y\right)}} \]
    8. Applied egg-rr90.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{x + y}}{\frac{y + 1}{y} \cdot \left(x + y\right)}} \]
    9. Taylor expanded in y around inf 89.9%

      \[\leadsto \frac{\frac{x}{x + y}}{\color{blue}{y}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 6 \cdot 10^{-127}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 0.00025:\\ \;\;\;\;y \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+148}:\\ \;\;\;\;\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{x + y}}{y}\\ \end{array} \]

Alternative 20: 45.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{-124}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4e-124)
   (* y (/ 1.0 x))
   (if (<= y 0.75) (- (/ x y) x) (/ x (* y y)))))
double code(double x, double y) {
	double tmp;
	if (y <= 4e-124) {
		tmp = y * (1.0 / x);
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4d-124) then
        tmp = y * (1.0d0 / x)
    else if (y <= 0.75d0) then
        tmp = (x / y) - x
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4e-124) {
		tmp = y * (1.0 / x);
	} else if (y <= 0.75) {
		tmp = (x / y) - x;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4e-124:
		tmp = y * (1.0 / x)
	elif y <= 0.75:
		tmp = (x / y) - x
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4e-124)
		tmp = Float64(y * Float64(1.0 / x));
	elseif (y <= 0.75)
		tmp = Float64(Float64(x / y) - x);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4e-124)
		tmp = y * (1.0 / x);
	elseif (y <= 0.75)
		tmp = (x / y) - x;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4e-124], N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.75], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-124}:\\
\;\;\;\;y \cdot \frac{1}{x}\\

\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 3.99999999999999973e-124

    1. Initial program 75.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac90.7%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+90.7%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified90.7%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 75.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative75.1%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified75.1%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Taylor expanded in y around 0 71.5%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{y} \]
    8. Taylor expanded in x around inf 42.2%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot y \]

    if 3.99999999999999973e-124 < y < 0.75

    1. Initial program 85.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac99.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+99.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 47.2%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in47.3%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity47.3%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified47.3%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]
    7. Taylor expanded in y around 0 46.0%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-146.0%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg46.0%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified46.0%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 0.75 < y

    1. Initial program 55.4%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-*r/71.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. *-commutative71.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. distribute-rgt1-in66.6%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def70.9%

        \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
      5. cube-unmult71.0%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified71.0%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Taylor expanded in y around inf 63.0%

      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
    5. Step-by-step derivation
      1. unpow263.0%

        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
    6. Simplified63.0%

      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{-124}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 21: 23.5% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-136}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - x\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -7.2e-136) (* y (/ 1.0 x)) (- (/ x y) x)))
double code(double x, double y) {
	double tmp;
	if (x <= -7.2e-136) {
		tmp = y * (1.0 / x);
	} else {
		tmp = (x / y) - x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-7.2d-136)) then
        tmp = y * (1.0d0 / x)
    else
        tmp = (x / y) - x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -7.2e-136) {
		tmp = y * (1.0 / x);
	} else {
		tmp = (x / y) - x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -7.2e-136:
		tmp = y * (1.0 / x)
	else:
		tmp = (x / y) - x
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -7.2e-136)
		tmp = Float64(y * Float64(1.0 / x));
	else
		tmp = Float64(Float64(x / y) - x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -7.2e-136)
		tmp = y * (1.0 / x);
	else
		tmp = (x / y) - x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -7.2e-136], N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-136}:\\
\;\;\;\;y \cdot \frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} - x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -7.1999999999999996e-136

    1. Initial program 70.7%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac89.5%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity89.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/89.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity89.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+89.5%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified89.5%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 70.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
    5. Step-by-step derivation
      1. +-commutative70.9%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
    6. Simplified70.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
    7. Taylor expanded in y around 0 65.3%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{y} \]
    8. Taylor expanded in x around inf 35.9%

      \[\leadsto \color{blue}{\frac{1}{x}} \cdot y \]

    if -7.1999999999999996e-136 < x

    1. Initial program 72.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac88.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity88.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/88.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity88.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+88.6%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified88.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    4. Taylor expanded in x around 0 53.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. distribute-rgt-in53.9%

        \[\leadsto \frac{x}{\color{blue}{1 \cdot y + y \cdot y}} \]
      2. *-lft-identity53.9%

        \[\leadsto \frac{x}{\color{blue}{y} + y \cdot y} \]
    6. Simplified53.9%

      \[\leadsto \color{blue}{\frac{x}{y + y \cdot y}} \]
    7. Taylor expanded in y around 0 17.9%

      \[\leadsto \color{blue}{\frac{x}{y} + -1 \cdot x} \]
    8. Step-by-step derivation
      1. neg-mul-117.9%

        \[\leadsto \frac{x}{y} + \color{blue}{\left(-x\right)} \]
      2. unsub-neg17.9%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified17.9%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.2 \cdot 10^{-136}:\\ \;\;\;\;y \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} - x\\ \end{array} \]

Alternative 22: 26.3% accurate, 3.4× speedup?

\[\begin{array}{l} \\ y \cdot \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (* y (/ 1.0 x)))
double code(double x, double y) {
	return y * (1.0 / x);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = y * (1.0d0 / x)
end function
public static double code(double x, double y) {
	return y * (1.0 / x);
}
def code(x, y):
	return y * (1.0 / x)
function code(x, y)
	return Float64(y * Float64(1.0 / x))
end
function tmp = code(x, y)
	tmp = y * (1.0 / x);
end
code[x_, y_] := N[(y * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
y \cdot \frac{1}{x}
\end{array}
Derivation
  1. Initial program 71.5%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. times-frac88.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. /-rgt-identity88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
    3. associate-/l/88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
    4. *-lft-identity88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
    5. associate-+l+88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified88.9%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in x around 0 76.3%

    \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 + y}} \]
  5. Step-by-step derivation
    1. +-commutative76.3%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{y + 1}} \]
  6. Simplified76.3%

    \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{y + 1}} \]
  7. Taylor expanded in y around 0 69.3%

    \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{y} \]
  8. Taylor expanded in x around inf 29.7%

    \[\leadsto \color{blue}{\frac{1}{x}} \cdot y \]
  9. Final simplification29.7%

    \[\leadsto y \cdot \frac{1}{x} \]

Alternative 23: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
	return 1.0 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
public static double code(double x, double y) {
	return 1.0 / x;
}
def code(x, y):
	return 1.0 / x
function code(x, y)
	return Float64(1.0 / x)
end
function tmp = code(x, y)
	tmp = 1.0 / x;
end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 71.5%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. times-frac88.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. /-rgt-identity88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
    3. associate-/l/88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
    4. *-lft-identity88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
    5. associate-+l+88.9%

      \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified88.9%

    \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
  4. Taylor expanded in x around inf 53.8%

    \[\leadsto \color{blue}{\frac{1}{x}} \cdot \frac{y}{x + \left(y + 1\right)} \]
  5. Taylor expanded in y around inf 4.2%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  6. Final simplification4.2%

    \[\leadsto \frac{1}{x} \]

Developer target: 99.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y):
	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y)
	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
end
function tmp = code(x, y)
	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}

Reproduce

?
herbie shell --seed 2023196 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))