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

Percentage Accurate: 68.9% → 99.8%
Time: 15.6s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 68.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\frac{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Derivation
  1. Initial program 70.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/83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 71.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e-162 < y < 3.55000000000000008e152

    1. Initial program 86.7%

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

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

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

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

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

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

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

    if 3.55000000000000008e152 < y

    1. Initial program 53.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/80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 67.2% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.5499999999999999e-162 < y < 8.0000000000000002e-8

    1. Initial program 86.5%

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

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

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

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

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

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

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

      \[\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. +-commutative99.0%

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

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

    if 8.0000000000000002e-8 < y

    1. Initial program 70.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/85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.1% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.39999999999999987e129 < x < -9e17

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

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

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

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

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

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

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

    if -9e17 < x < -1.35e-127

    1. Initial program 80.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/93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-127 < x

    1. Initial program 72.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/83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.4 \cdot 10^{+129}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -9 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\ \;\;\;\;\frac{\frac{y}{x + \left(y + 1\right)}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \]

Alternative 5: 62.0% accurate, 1.0× speedup?

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

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

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

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

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


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

    1. Initial program 57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.84999999999999989e129 < x < -9e17

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

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

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

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

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

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

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

    if -9e17 < x < -1.35e-127

    1. Initial program 80.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/93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-127 < x

    1. Initial program 72.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/83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{+129}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -9 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{x}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \]

Alternative 6: 99.8% accurate, 1.0× speedup?

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

\\
\frac{x}{y + x} \cdot \frac{\frac{y}{x + \left(y + 1\right)}}{y + x}
\end{array}
Derivation
  1. Initial program 70.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-frac87.6%

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

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

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

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

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

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

Alternative 7: 62.4% accurate, 1.1× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.6000000000000001e-8

    1. Initial program 56.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/75.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]
    7. Step-by-step derivation
      1. clear-num26.3%

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

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

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

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

        \[\leadsto \frac{1}{\frac{x \cdot x}{\color{blue}{1 \cdot y}}} \]
      3. times-frac33.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{1} \cdot \frac{x}{y}}} \]
      4. /-rgt-identity33.7%

        \[\leadsto \frac{1}{\color{blue}{x} \cdot \frac{x}{y}} \]
    10. Simplified33.7%

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

    if -2.6000000000000001e-8 < y < 1.0600000000000001e-57

    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-frac89.0%

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

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

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

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

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

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

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

    if 1.0600000000000001e-57 < y < 1.6e7

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

    if 1.6e7 < y < 5.4e10

    1. Initial program 98.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.4%

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

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

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

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

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

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

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

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

    if 5.4e10 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot 1}{y}} \]
      2. *-rgt-identity81.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
    10. Simplified81.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-8}:\\ \;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{-57}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 16000000:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 54000000000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 8: 62.4% accurate, 1.1× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.6000000000000001e-8

    1. Initial program 56.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/75.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]
    7. Step-by-step derivation
      1. clear-num26.3%

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

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

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

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

        \[\leadsto \frac{1}{\frac{x \cdot x}{\color{blue}{1 \cdot y}}} \]
      3. times-frac33.7%

        \[\leadsto \frac{1}{\color{blue}{\frac{x}{1} \cdot \frac{x}{y}}} \]
      4. /-rgt-identity33.7%

        \[\leadsto \frac{1}{\color{blue}{x} \cdot \frac{x}{y}} \]
    10. Simplified33.7%

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

    if -2.6000000000000001e-8 < y < 1.0999999999999999e-59

    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-frac89.0%

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

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

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

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

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

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

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

    if 1.0999999999999999e-59 < y < 8e6

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

    if 8e6 < y < 1.06e16

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

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

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

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

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

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

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

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

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

    if 1.06e16 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-8}:\\ \;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{-59}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 8000000:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 1.06 \cdot 10^{+16}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y + x}\\ \end{array} \]

Alternative 9: 56.2% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.80000000000000012e-124 or 1.2600000000000001e-105 < y < 1.35e13

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

    if -3.80000000000000012e-124 < y < 1.2600000000000001e-105

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

    if 1.35e13 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot 1}{y}} \]
      2. *-rgt-identity83.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
    10. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 13500000000000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 10: 56.0% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 3.3 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\

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

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


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

    1. Initial program 64.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/79.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]
    7. Step-by-step derivation
      1. clear-num34.4%

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

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

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

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

        \[\leadsto \frac{1}{\frac{x \cdot x}{\color{blue}{1 \cdot y}}} \]
      3. times-frac40.1%

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

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

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

    if -1.05e-125 < y < 3.2999999999999999e-105

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

    if 3.2999999999999999e-105 < y < 2.7e11

    1. Initial program 95.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-frac99.5%

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

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

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

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

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

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

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

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

    if 2.7e11 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot 1}{y}} \]
      2. *-rgt-identity81.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
    10. Simplified81.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{-125}:\\ \;\;\;\;\frac{1}{x \cdot \frac{x}{y}}\\ \mathbf{elif}\;y \leq 3.3 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 270000000000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 11: 62.5% accurate, 1.3× speedup?

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

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

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

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.1499999999999999e-58 < y < 1.16e7

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

    if 1.16e7 < y < 8.5e15

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

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

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

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

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

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

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

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

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

    if 8.5e15 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 55.2% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.99999999999999973e-124 or 1.2600000000000001e-105 < y < 2e12

    1. Initial program 71.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/82.4%

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

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

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

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

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

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

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

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

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

    if -3.99999999999999973e-124 < y < 1.2600000000000001e-105

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

    if 2e12 < y

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 2000000000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 13: 55.6% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;y \leq 6.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 2.05 \cdot 10^{+14}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.99999999999999973e-124 or 6.09999999999999985e-105 < y < 2.05e14

    1. Initial program 71.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.5%

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

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

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

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

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

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

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

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

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

    if -3.99999999999999973e-124 < y < 6.09999999999999985e-105

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

    if 2.05e14 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{x}{y} \cdot 1}{y}} \]
      2. *-rgt-identity83.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y}}}{y} \]
    10. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-124}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{+14}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 14: 59.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\ \;\;\;\;\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) (/ 1.0 x))
   (if (<= x -1.35e-127) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.0) {
		tmp = (y / x) * (1.0 / x);
	} else if (x <= -1.35e-127) {
		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) * (1.0d0 / x)
    else if (x <= (-1.35d-127)) 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) * (1.0 / x);
	} else if (x <= -1.35e-127) {
		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) * (1.0 / x)
	elif x <= -1.35e-127:
		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) * Float64(1.0 / x));
	elseif (x <= -1.35e-127)
		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) * (1.0 / x);
	elseif (x <= -1.35e-127)
		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] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-127], 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{y}{x} \cdot \frac{1}{x}\\

\mathbf{elif}\;x \leq -1.35 \cdot 10^{-127}:\\
\;\;\;\;\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.9%

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.35e-127

    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.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    7. Simplified55.8%

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

    if -1.35e-127 < x

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 60.3% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{x + 1}} \cdot \frac{y}{x} \]
    6. Applied egg-rr68.8%

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

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

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

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

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

    if -9.50000000000000006e-128 < x

    1. Initial program 72.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/83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -9.5 \cdot 10^{-128}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \]

Alternative 16: 60.5% accurate, 1.5× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-127 < x

    1. Initial program 72.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/83.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 45.4% accurate, 1.9× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

    if 1.2e-61 < y < 0.76000000000000001

    1. Initial program 94.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-frac99.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.76000000000000001 < y

    1. Initial program 69.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/85.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 18: 26.9% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 63.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/78.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999981e-10 < x

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-10}:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 19: 33.8% accurate, 3.4× speedup?

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

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

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]
    5. Taylor expanded in x around 0 36.1%

      \[\leadsto \frac{y}{\color{blue}{x}} \]

    if -1.15000000000000009e-127 < x

    1. Initial program 72.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac86.3%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1}}{1}} \]
      3. associate-/l/86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \color{blue}{\frac{y}{1 \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. *-lft-identity86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
      5. associate-+l+86.3%

        \[\leadsto \frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.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 60.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    5. Step-by-step derivation
      1. +-commutative60.6%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    6. Simplified60.6%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    7. Taylor expanded in y around 0 34.1%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification34.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{-127}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]

Alternative 20: 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 70.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/83.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    2. *-commutative83.1%

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    3. distribute-rgt1-in65.4%

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    4. fma-def83.1%

      \[\leadsto x \cdot \frac{y}{\color{blue}{\mathsf{fma}\left(x + y, x + y, \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)\right)}} \]
    5. cube-unmult83.1%

      \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
  3. Simplified83.1%

    \[\leadsto \color{blue}{x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
  4. Step-by-step derivation
    1. associate-*r/70.6%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    2. fma-udef57.1%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult57.1%

      \[\leadsto \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    4. distribute-rgt1-in70.6%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    5. associate-+r+70.6%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
    6. *-commutative70.6%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. frac-times87.6%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
    8. *-commutative87.6%

      \[\leadsto \color{blue}{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    9. associate-/r*99.8%

      \[\leadsto \frac{y}{x + \left(y + 1\right)} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
    10. associate-*r/99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{x + y}}{x + y}} \]
  5. Applied egg-rr99.9%

    \[\leadsto \color{blue}{\frac{\frac{y}{x + \left(y + 1\right)} \cdot \frac{x}{x + y}}{x + y}} \]
  6. Step-by-step derivation
    1. *-commutative99.9%

      \[\leadsto \frac{\color{blue}{\frac{x}{x + y} \cdot \frac{y}{x + \left(y + 1\right)}}}{x + y} \]
    2. clear-num99.8%

      \[\leadsto \frac{\frac{x}{x + y} \cdot \color{blue}{\frac{1}{\frac{x + \left(y + 1\right)}{y}}}}{x + y} \]
    3. un-div-inv99.8%

      \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y}}{\frac{x + \left(y + 1\right)}{y}}}}{x + y} \]
    4. +-commutative99.8%

      \[\leadsto \frac{\frac{\frac{x}{\color{blue}{y + x}}}{\frac{x + \left(y + 1\right)}{y}}}{x + y} \]
    5. +-commutative99.8%

      \[\leadsto \frac{\frac{\frac{x}{y + x}}{\frac{\color{blue}{\left(y + 1\right) + x}}{y}}}{x + y} \]
    6. associate-+l+99.8%

      \[\leadsto \frac{\frac{\frac{x}{y + x}}{\frac{\color{blue}{y + \left(1 + x\right)}}{y}}}{x + y} \]
    7. +-commutative99.8%

      \[\leadsto \frac{\frac{\frac{x}{y + x}}{\frac{y + \color{blue}{\left(x + 1\right)}}{y}}}{x + y} \]
  7. Applied egg-rr99.8%

    \[\leadsto \frac{\color{blue}{\frac{\frac{x}{y + x}}{\frac{y + \left(x + 1\right)}{y}}}}{x + y} \]
  8. Taylor expanded in y around inf 41.9%

    \[\leadsto \frac{\frac{\frac{x}{y + x}}{\color{blue}{1}}}{x + y} \]
  9. Taylor expanded in x around inf 4.3%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  10. Final simplification4.3%

    \[\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 2023200 
(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))))