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

Percentage Accurate: 69.2% → 99.8%
Time: 13.8s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 69.2% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{y}{y + \left(x + 1\right)} \cdot \frac{x}{y + x}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (/ (* (/ y (+ y (+ x 1.0))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
	return ((y / (y + (x + 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 / (y + (x + 1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
	return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
}
def code(x, y):
	return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x)
function code(x, y)
	return Float64(Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(x / Float64(y + x))) / Float64(y + x))
end
function tmp = code(x, y)
	tmp = ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
end
code[x_, y_] := N[(N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

      \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
  3. Simplified79.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/65.7%

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

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

      \[\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+65.7%

      \[\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. *-commutative65.7%

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

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

      \[\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}} \]
    11. +-commutative99.8%

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

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

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

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

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

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

Alternative 2: 62.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;x \leq -3.8 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.29999999999999994e-63 or -3.8000000000000002e-76 < x < -2.4000000000000002e-236

    1. Initial program 66.5%

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

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified82.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/66.5%

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

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

        \[\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-in66.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+66.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. *-commutative66.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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.29999999999999994e-63 < x < -3.8000000000000002e-76

    1. Initial program 99.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/99.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. *-commutative99.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-in99.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-def99.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-unmult99.8%

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

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

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

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

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

    if -2.4000000000000002e-236 < x

    1. Initial program 63.0%

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def75.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-unmult75.0%

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult51.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-in63.0%

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

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

        \[\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-times83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x - -1\right)\right)}\\ \end{array} \]

Alternative 3: 84.5% accurate, 0.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

    if -6.4000000000000003e-21 < x

    1. Initial program 68.9%

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in65.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-def79.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-unmult79.0%

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult56.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-in68.9%

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

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

        \[\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-times85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 60.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{y}{x} - y\\

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-77}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;x \leq 1.05 \cdot 10^{+18}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 56.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/79.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. *-commutative79.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-in21.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-def79.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-unmult79.0%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified79.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 x around inf 77.8%

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

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

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

    if -1 < x < -2.5e-32

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e-32 < x < -8.4999999999999998e-77 or -1.59999999999999991e-105 < x < 1.05e18

    1. Initial program 76.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-frac87.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-identity87.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/87.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-identity87.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+87.2%

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

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

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

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

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

    if -8.4999999999999998e-77 < x < -1.59999999999999991e-105

    1. Initial program 88.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-frac100.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-identity100.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/100.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-identity100.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+100.0%

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

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

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

    if 1.05e18 < x

    1. Initial program 50.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/63.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. *-commutative63.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-in62.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-def63.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-unmult63.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-32}:\\ \;\;\;\;\frac{y}{x} - y\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-77}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;x \leq -1.6 \cdot 10^{-105}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+18}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\ \end{array} \]

Alternative 5: 61.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -2.15 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{y \cdot y}\\

\mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1e-58 or -2.15e-75 < x < -2.4000000000000002e-236

    1. Initial program 66.5%

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

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified82.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/66.5%

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

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

        \[\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-in66.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+66.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. *-commutative66.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.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e-58 < x < -2.15e-75

    1. Initial program 99.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/99.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. *-commutative99.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-in99.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-def99.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-unmult99.8%

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

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

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

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

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

    if -2.4000000000000002e-236 < x < 2.05e17

    1. Initial program 72.1%

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

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity86.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/86.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-identity86.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+86.5%

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

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

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

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

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

    if 2.05e17 < x

    1. Initial program 50.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/63.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. *-commutative63.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-in62.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-def63.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-unmult63.9%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified63.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/50.8%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in50.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+50.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. *-commutative50.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-times78.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{-58}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{-75}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\ \mathbf{elif}\;x \leq 2.05 \cdot 10^{+17}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\ \end{array} \]

Alternative 6: 80.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 58.2%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified79.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/58.3%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult25.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-in58.2%

        \[\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+58.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. *-commutative58.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-times91.4%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{x + \left(y + 1\right)}} \]
      8. *-commutative91.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.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}} \]
      11. +-commutative99.9%

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

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

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

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

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

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

    if -7.1999999999999998e-25 < x

    1. Initial program 68.9%

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      3. distribute-rgt1-in65.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-def79.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-unmult79.0%

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult56.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-in68.9%

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

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

        \[\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-times85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(x + 1\right)}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ x (+ y x)) (/ (/ y (+ y (+ x 1.0))) (+ y x))))
double code(double x, double y) {
	return (x / (y + x)) * ((y / (y + (x + 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 / (y + (x + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
	return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
}
def code(x, y):
	return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x))
function code(x, y)
	return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(y + x)))
end
function tmp = code(x, y)
	tmp = (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

      \[\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}} \]
    5. +-commutative99.8%

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

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

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

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

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

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

Alternative 8: 62.5% accurate, 1.1× speedup?

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

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

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

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

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

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


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

    1. Initial program 54.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified76.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/54.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult18.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-in54.0%

        \[\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+54.0%

        \[\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. *-commutative54.0%

        \[\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.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}} \]
      11. +-commutative99.9%

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

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

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

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

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

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

    if -9.5000000000000001e-7 < y < 5.1999999999999999e-41 or 3.2000000000000002e-21 < y < 3e7

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

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. /-rgt-identity88.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/88.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-identity88.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+88.4%

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

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

    if 5.1999999999999999e-41 < y < 3.2000000000000002e-21

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

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

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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/52.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in52.0%

        \[\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+52.0%

        \[\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. *-commutative52.0%

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-41}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{elif}\;y \leq 30000000:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y}\\ \end{array} \]

Alternative 9: 62.5% accurate, 1.1× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.4e-41 or 2.0000000000000001e-18 < y < 3e7

    1. Initial program 69.0%

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def80.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-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/69.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult45.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-in69.0%

        \[\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+69.0%

        \[\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. *-commutative69.0%

        \[\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-times88.1%

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

        \[\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}} \]
      11. +-commutative99.9%

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

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

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

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

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

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

    if 5.4e-41 < y < 2.0000000000000001e-18

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

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

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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/52.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in52.0%

        \[\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+52.0%

        \[\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. *-commutative52.0%

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 61.5% accurate, 1.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 4.9999999999999996e-41 or 1.55000000000000003e-18 < y < 2.7e7

    1. Initial program 69.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-frac88.1%

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

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

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

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

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

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

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

    if 4.9999999999999996e-41 < y < 1.55000000000000003e-18

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

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

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

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

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

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

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

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

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

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

    if 2.7e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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 65.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    9. Step-by-step derivation
      1. *-commutative68.0%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
      2. associate-*r/68.0%

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

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

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

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

Alternative 11: 61.6% accurate, 1.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.4e-41 or 3.50000000000000005e-22 < y < 3e7

    1. Initial program 69.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-frac88.1%

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

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

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

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

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

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

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

    if 5.4e-41 < y < 3.50000000000000005e-22

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

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

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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/52.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in52.0%

        \[\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+52.0%

        \[\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. *-commutative52.0%

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

Alternative 12: 61.6% accurate, 1.3× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 5.1999999999999999e-41 or 3.70000000000000005e-19 < y < 2.2e7

    1. Initial program 69.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-frac88.1%

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

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

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

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

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

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

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

    if 5.1999999999999999e-41 < y < 3.70000000000000005e-19

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

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

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

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

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

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

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

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

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

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

    if 2.2e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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/52.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in52.0%

        \[\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+52.0%

        \[\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. *-commutative52.0%

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 62.2% accurate, 1.3× speedup?

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

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

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

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

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


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

    1. Initial program 69.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{y}{1 + x}}{x}} \]
      2. div-inv57.5%

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

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

    if 5.4e-41 < y < 3.00000000000000029e-20

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

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

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

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

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

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

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

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

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

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

    if 3.00000000000000029e-20 < y < 3e7

    1. Initial program 62.3%

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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/52.0%

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.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-in52.0%

        \[\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+52.0%

        \[\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. *-commutative52.0%

        \[\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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 54.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -1.06 \cdot 10^{-181}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-118}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 30000000:\\ \;\;\;\;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 -1.06e-181)
     t_0
     (if (<= y 1.7e-118) (/ y x) (if (<= y 30000000.0) t_0 (/ x (* y y)))))))
double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -1.06e-181) {
		tmp = t_0;
	} else if (y <= 1.7e-118) {
		tmp = y / x;
	} else if (y <= 30000000.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 <= (-1.06d-181)) then
        tmp = t_0
    else if (y <= 1.7d-118) then
        tmp = y / x
    else if (y <= 30000000.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 <= -1.06e-181) {
		tmp = t_0;
	} else if (y <= 1.7e-118) {
		tmp = y / x;
	} else if (y <= 30000000.0) {
		tmp = t_0;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (x * x)
	tmp = 0
	if y <= -1.06e-181:
		tmp = t_0
	elif y <= 1.7e-118:
		tmp = y / x
	elif y <= 30000000.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 <= -1.06e-181)
		tmp = t_0;
	elseif (y <= 1.7e-118)
		tmp = Float64(y / x);
	elseif (y <= 30000000.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 <= -1.06e-181)
		tmp = t_0;
	elseif (y <= 1.7e-118)
		tmp = y / x;
	elseif (y <= 30000000.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, -1.06e-181], t$95$0, If[LessEqual[y, 1.7e-118], N[(y / x), $MachinePrecision], If[LessEqual[y, 30000000.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 -1.06 \cdot 10^{-181}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.06000000000000001e-181 or 1.69999999999999995e-118 < y < 3e7

    1. Initial program 65.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/81.0%

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

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def81.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-unmult81.0%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified81.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 x around inf 34.5%

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

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

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

    if -1.06000000000000001e-181 < y < 1.69999999999999995e-118

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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 65.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.06 \cdot 10^{-181}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-118}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 30000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \]

Alternative 15: 55.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{x \cdot x}\\ \mathbf{if}\;y \leq -3 \cdot 10^{-182}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-116}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 30000000:\\ \;\;\;\;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 -3e-182)
     t_0
     (if (<= y 1.05e-116) (/ y x) (if (<= y 30000000.0) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
	double t_0 = y / (x * x);
	double tmp;
	if (y <= -3e-182) {
		tmp = t_0;
	} else if (y <= 1.05e-116) {
		tmp = y / x;
	} else if (y <= 30000000.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 <= (-3d-182)) then
        tmp = t_0
    else if (y <= 1.05d-116) then
        tmp = y / x
    else if (y <= 30000000.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 <= -3e-182) {
		tmp = t_0;
	} else if (y <= 1.05e-116) {
		tmp = y / x;
	} else if (y <= 30000000.0) {
		tmp = t_0;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	t_0 = y / (x * x)
	tmp = 0
	if y <= -3e-182:
		tmp = t_0
	elif y <= 1.05e-116:
		tmp = y / x
	elif y <= 30000000.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 <= -3e-182)
		tmp = t_0;
	elseif (y <= 1.05e-116)
		tmp = Float64(y / x);
	elseif (y <= 30000000.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 * x);
	tmp = 0.0;
	if (y <= -3e-182)
		tmp = t_0;
	elseif (y <= 1.05e-116)
		tmp = y / x;
	elseif (y <= 30000000.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, -3e-182], t$95$0, If[LessEqual[y, 1.05e-116], N[(y / x), $MachinePrecision], If[LessEqual[y, 30000000.0], 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 -3 \cdot 10^{-182}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{-116}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.0000000000000001e-182 or 1.05e-116 < y < 3e7

    1. Initial program 65.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/81.0%

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

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + \left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. fma-def81.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-unmult81.0%

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified81.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 x around inf 34.5%

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

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

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

    if -3.0000000000000001e-182 < y < 1.05e-116

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

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

    if 3e7 < y

    1. Initial program 52.0%

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

        \[\leadsto x \cdot \frac{y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(x + y\right)}^{3}}\right)} \]
    3. Simplified72.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 65.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y}} \]
    9. Step-by-step derivation
      1. *-commutative68.0%

        \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{1}{y}} \]
      2. associate-*r/68.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{-182}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{-116}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 30000000:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]

Alternative 16: 53.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.9 \cdot 10^{+142} \lor \neg \left(y \leq 6 \cdot 10^{-54}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -4.9e+142) (not (<= y 6e-54))) (/ x (* y y)) (/ y x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -4.9e+142) || !(y <= 6e-54)) {
		tmp = x / (y * y);
	} else {
		tmp = y / x;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if ((y <= (-4.9d+142)) .or. (.not. (y <= 6d-54))) then
        tmp = x / (y * y)
    else
        tmp = y / x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -4.9e+142) || !(y <= 6e-54)) {
		tmp = x / (y * y);
	} else {
		tmp = y / x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -4.9e+142) or not (y <= 6e-54):
		tmp = x / (y * y)
	else:
		tmp = y / x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -4.9e+142) || !(y <= 6e-54))
		tmp = Float64(x / Float64(y * y));
	else
		tmp = Float64(y / x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -4.9e+142) || ~((y <= 6e-54)))
		tmp = x / (y * y);
	else
		tmp = y / x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -4.9e+142], N[Not[LessEqual[y, 6e-54]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+142} \lor \neg \left(y \leq 6 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.90000000000000051e142 or 6.00000000000000018e-54 < y

    1. Initial program 56.2%

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

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

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

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

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

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

    if -4.90000000000000051e142 < y < 6.00000000000000018e-54

    1. Initial program 73.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-frac88.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.9 \cdot 10^{+142} \lor \neg \left(y \leq 6 \cdot 10^{-54}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]

Alternative 17: 4.2% accurate, 5.7× speedup?

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

\\
\frac{1}{y}
\end{array}
Derivation
  1. Initial program 65.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-frac87.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-identity87.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/87.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-identity87.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+87.0%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  8. Final simplification4.3%

    \[\leadsto \frac{1}{y} \]

Alternative 18: 26.4% accurate, 5.7× speedup?

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

\\
\frac{y}{x}
\end{array}
Derivation
  1. Initial program 65.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-frac87.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-identity87.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/87.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-identity87.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+87.0%

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

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

    \[\leadsto \frac{y}{\color{blue}{x}} \]
  6. Final simplification28.2%

    \[\leadsto \frac{y}{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 2023171 
(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))))