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

Percentage Accurate: 69.1% → 99.8%
Time: 18.4s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 69.1% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

    if 2.1999999999999999e-23 < y < 1.7e122

    1. Initial program 81.6%

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

    if 1.7e122 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 53.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+53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{y}{y + x}}{x + \left(y + -1 \cdot \left(-1 + \color{blue}{\left(-y\right)}\right)\right)} \]
      10. distribute-lft-in88.0%

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

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

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

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

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

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

    if -1.08000000000000005e167 < x < -1.85e-156

    1. Initial program 76.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-frac98.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-+l+98.5%

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

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

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

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

    if -1.85e-156 < x

    1. Initial program 68.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.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 54.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -1.58 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq -7.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;x \leq 1.45 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/l/78.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    10. Simplified78.1%

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

    if -1 < x < -1.58e-90

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

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

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

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

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

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

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

    if -1.58e-90 < x < -7.20000000000000007e-139

    1. Initial program 99.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*99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.20000000000000007e-139 < x < -8.00000000000000011e-155

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000011e-155 < x < 1.4500000000000001e-104

    1. Initial program 64.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-frac79.8%

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

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

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

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

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

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

    if 1.4500000000000001e-104 < x

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.58 \cdot 10^{-90}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -7.2 \cdot 10^{-139}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{-104}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\ \end{array} \]

Alternative 5: 81.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 68.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+68.1%

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

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

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

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

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

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

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

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

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

    if 6.4e10 < y

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.7% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 64.9%

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

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

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

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

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

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

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

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

    if -8.79999999999999942e-15 < x

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 52.9% accurate, 1.1× speedup?

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

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

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

\mathbf{elif}\;x \leq -1.06 \cdot 10^{-139}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -2 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;x \leq 1.6 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.34999999999999998e-90

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

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

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

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

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

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

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

    if -1.34999999999999998e-90 < x < -1.05999999999999997e-139 or 1.59999999999999994e-104 < x

    1. Initial program 74.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*78.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05999999999999997e-139 < x < -2.00000000000000003e-155

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e-155 < x < 1.59999999999999994e-104

    1. Initial program 64.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-frac79.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-90}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -1.06 \cdot 10^{-139}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.6 \cdot 10^{-104}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 8: 53.6% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq -1.12 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-139}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq -6.8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;x \leq 1.02 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/l/78.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    10. Simplified78.1%

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

    if -1 < x < -1.12e-90

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

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

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

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

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

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

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

    if -1.12e-90 < x < -2.50000000000000017e-139 or 1.02000000000000001e-104 < x

    1. Initial program 74.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*78.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000017e-139 < x < -6.8e-155

    1. Initial program 52.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8e-155 < x < 1.02000000000000001e-104

    1. Initial program 64.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-frac79.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.12 \cdot 10^{-90}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-139}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -6.8 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-104}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 9: 63.2% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e-82 < y

    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. associate-/r*82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 52.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;y \leq 3.4 \cdot 10^{-222}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.00000000000000019e144 or 5.2e10 < y

    1. Initial program 60.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000019e144 < y < 3.4000000000000001e-222

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity66.6%

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

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

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

    if 3.4000000000000001e-222 < y < 5.2e10

    1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    9. Simplified28.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+144}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-222}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 52000000000:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 11: 60.3% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;x \leq -7.7 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x} - y\\

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/l/78.1%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x}} \]
    10. Simplified78.1%

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

    if -1 < x < -7.6999999999999997e-91

    1. Initial program 86.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot 1 + x \cdot x}} \]
      3. *-rgt-identity43.9%

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

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

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

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

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

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

    if -7.6999999999999997e-91 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-+l+86.9%

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

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

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

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

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

Alternative 12: 60.4% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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+53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/l/87.5%

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

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

    if -4.25000000000000003e167 < x < -1.3999999999999999e-90

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999e-90 < x

    1. Initial program 69.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.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-+l+86.9%

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

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

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

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

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

Alternative 13: 60.9% accurate, 1.5× speedup?

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

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

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

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


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

    1. Initial program 53.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+53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
      2. associate-/l/87.5%

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

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

    if -1.65000000000000009e167 < x < -9.7999999999999996e-91

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.7999999999999996e-91 < x

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 62.4% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e-82 < y

    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. associate-/r*82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 62.3% accurate, 1.9× speedup?

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

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

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


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

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-82 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-82}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + 1}\\ \end{array} \]

Alternative 16: 26.7% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

    if -1.44999999999999996 < x

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 17: 33.0% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 69.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.80000000000000021e-155 < x

    1. Initial program 68.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-frac85.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-+l+85.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 18: 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 68.6%

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

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

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

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

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

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

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

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
  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 2023279 
(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))))