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

Percentage Accurate: 68.7% → 99.8%
Time: 18.0s
Alternatives: 19
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 19 alternatives:

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

Initial Program: 68.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 66.1% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-131}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 7 \cdot 10^{-17}:\\
\;\;\;\;t_0\\

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


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

    1. Initial program 61.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-frac85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e-294 < y < 4.1000000000000002e-131 or 5.79999999999999971e-62 < y < 7.0000000000000003e-17

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.1000000000000002e-131 < y < 5.79999999999999971e-62

    1. Initial program 79.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*90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000003e-17 < y

    1. Initial program 70.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-frac92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-294}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-131}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-17}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{1}{x + \left(y + \left(x + 1\right)\right)}}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-129}:\\
\;\;\;\;t_0\\

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

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

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


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

    1. Initial program 61.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-frac85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e-294 < y < 1.19999999999999994e-129 or 1.69999999999999994e-62 < y < 0.46000000000000002

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.19999999999999994e-129 < y < 1.69999999999999994e-62

    1. Initial program 79.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*90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.46000000000000002 < y

    1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-294}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-129}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 0.46:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 64.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-130}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-13}:\\
\;\;\;\;t_0\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000004e-296 < y < 2.10000000000000002e-130 or 7.40000000000000004e-68 < y < 3.8e-13

    1. Initial program 78.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*80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000002e-130 < y < 7.40000000000000004e-68

    1. Initial program 79.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*90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8e-13 < y

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{-296}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-130}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-68}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 66.1% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 61.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-frac85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.09999999999999984e-294 < y < 1.6e-130

    1. Initial program 72.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*72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6e-130 < y < 9.00000000000000031e-67

    1. Initial program 79.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*90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.00000000000000031e-67 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{-294}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-130}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{y + x}\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.5% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{x}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.49999999999999935e-8 or 3.8e9 < y

    1. Initial program 61.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity61.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.49999999999999935e-8 < y < 4.50000000000000012e-59

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.50000000000000012e-59 < y < 3.8e9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.6% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3999999999999999e-32 < y

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-66 < y < 6.6000000000000001e-13

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6000000000000001e-13 < y

    1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 82.8% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000003e-17 < y

    1. Initial program 70.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-frac92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 62.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-20} \lor \neg \left(y \leq 2.7 \cdot 10^{-59}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (or (<= y -4e-20) (not (<= y 2.7e-59))) (/ x (* y (+ y 1.0))) (/ y x)))
double code(double x, double y) {
	double tmp;
	if ((y <= -4e-20) || !(y <= 2.7e-59)) {
		tmp = x / (y * (y + 1.0));
	} 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 <= (-4d-20)) .or. (.not. (y <= 2.7d-59))) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = y / x
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if ((y <= -4e-20) || !(y <= 2.7e-59)) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = y / x;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if (y <= -4e-20) or not (y <= 2.7e-59):
		tmp = x / (y * (y + 1.0))
	else:
		tmp = y / x
	return tmp
function code(x, y)
	tmp = 0.0
	if ((y <= -4e-20) || !(y <= 2.7e-59))
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(y / x);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if ((y <= -4e-20) || ~((y <= 2.7e-59)))
		tmp = x / (y * (y + 1.0));
	else
		tmp = y / x;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[Or[LessEqual[y, -4e-20], N[Not[LessEqual[y, 2.7e-59]], $MachinePrecision]], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{-20} \lor \neg \left(y \leq 2.7 \cdot 10^{-59}\right):\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.99999999999999978e-20 or 2.6999999999999999e-59 < y

    1. Initial program 65.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*72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999978e-20 < y < 2.6999999999999999e-59

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x + y}{y}}} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y} \]
      2. frac-times99.7%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot x}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
      3. *-un-lft-identity99.7%

        \[\leadsto \frac{\frac{\color{blue}{x}}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
      4. +-commutative99.7%

        \[\leadsto \frac{\frac{x}{\frac{\color{blue}{y + x}}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
    8. Applied egg-rr99.7%

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
    9. Taylor expanded in y around 0 79.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    10. Step-by-step derivation
      1. +-commutative79.7%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    11. Simplified79.7%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    12. Taylor expanded in x around 0 55.1%

      \[\leadsto \color{blue}{\frac{y}{x}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{-20} \lor \neg \left(y \leq 2.7 \cdot 10^{-59}\right):\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 44.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 2.7e-59)
   (/ y x)
   (if (<= y 0.76) (- (/ x y) x) (* (/ x y) (/ 1.0 y)))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.7e-59) {
		tmp = y / x;
	} else if (y <= 0.76) {
		tmp = (x / y) - x;
	} else {
		tmp = (x / y) * (1.0 / y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.7d-59) then
        tmp = y / x
    else if (y <= 0.76d0) then
        tmp = (x / y) - x
    else
        tmp = (x / y) * (1.0d0 / y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.7e-59) {
		tmp = y / x;
	} else if (y <= 0.76) {
		tmp = (x / y) - x;
	} else {
		tmp = (x / y) * (1.0 / y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.7e-59:
		tmp = y / x
	elif y <= 0.76:
		tmp = (x / y) - x
	else:
		tmp = (x / y) * (1.0 / y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.7e-59)
		tmp = Float64(y / x);
	elseif (y <= 0.76)
		tmp = Float64(Float64(x / y) - x);
	else
		tmp = Float64(Float64(x / y) * Float64(1.0 / y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.7e-59)
		tmp = y / x;
	elseif (y <= 0.76)
		tmp = (x / y) - x;
	else
		tmp = (x / y) * (1.0 / y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.7e-59], N[(y / x), $MachinePrecision], If[LessEqual[y, 0.76], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{elif}\;y \leq 0.76:\\
\;\;\;\;\frac{x}{y} - x\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.6999999999999999e-59

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative85.6%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac66.6%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/79.0%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative79.0%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in57.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef51.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult51.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in66.6%

        \[\leadsto \frac{y \cdot x}{\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.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative66.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times85.5%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x + y}{y}}} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y} \]
      2. frac-times99.5%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot x}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
      3. *-un-lft-identity99.5%

        \[\leadsto \frac{\frac{\color{blue}{x}}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
      4. +-commutative99.5%

        \[\leadsto \frac{\frac{x}{\frac{\color{blue}{y + x}}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
    8. Applied egg-rr99.5%

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
    9. Taylor expanded in y around 0 62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    10. Step-by-step derivation
      1. +-commutative62.0%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    11. Simplified62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    12. Taylor expanded in x around 0 37.6%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 2.6999999999999999e-59 < y < 0.76000000000000001

    1. Initial program 91.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*99.4%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative99.4%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative99.4%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative99.4%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/99.6%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative99.6%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/99.6%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg99.6%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative99.6%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative99.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg99.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative99.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+99.6%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified99.6%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 37.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative37.5%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified37.5%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Taylor expanded in y around 0 37.5%

      \[\leadsto \color{blue}{-1 \cdot x + \frac{x}{y}} \]
    9. Step-by-step derivation
      1. neg-mul-137.5%

        \[\leadsto \color{blue}{\left(-x\right)} + \frac{x}{y} \]
      2. +-commutative37.5%

        \[\leadsto \color{blue}{\frac{x}{y} + \left(-x\right)} \]
      3. unsub-neg37.5%

        \[\leadsto \color{blue}{\frac{x}{y} - x} \]
    10. Simplified37.5%

      \[\leadsto \color{blue}{\frac{x}{y} - x} \]

    if 0.76000000000000001 < y

    1. Initial program 70.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*78.1%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative78.1%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative78.1%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative78.1%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/91.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative91.8%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/91.8%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg91.8%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative91.8%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative91.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg91.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative91.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+91.8%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified91.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 76.2%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    6. Taylor expanded in y around inf 75.6%

      \[\leadsto \frac{1}{y} \cdot \color{blue}{\frac{x}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 0.76:\\ \;\;\;\;\frac{x}{y} - x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ y (+ y x)) (/ (/ x (+ y (+ x 1.0))) (+ y x))))
double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y / (y + x)) * ((x / (y + (x + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
}
def code(x, y):
	return (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x))
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + Float64(x + 1.0))) / Float64(y + x)))
end
function tmp = code(x, y)
	tmp = (y / (y + x)) * ((x / (y + (x + 1.0))) / (y + x));
end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x}
\end{array}
Derivation
  1. Initial program 68.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. associate-+r+68.6%

      \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    2. *-commutative68.6%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)} \]
    3. frac-times87.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. associate-*l/83.1%

      \[\leadsto \color{blue}{\frac{y \cdot \frac{x}{x + \left(y + 1\right)}}{\left(x + y\right) \cdot \left(x + y\right)}} \]
    5. times-frac99.8%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{x + y}} \]
    6. associate-+r+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
    7. +-commutative99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
    8. associate-+l+99.8%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
  4. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{x + y}} \]
  5. Final simplification99.8%

    \[\leadsto \frac{y}{y + x} \cdot \frac{\frac{x}{y + \left(x + 1\right)}}{y + x} \]
  6. Add Preprocessing

Alternative 13: 63.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 3e-13) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y (+ x 1.0))))))
double code(double x, double y) {
	double tmp;
	if (y <= 3e-13) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = x / (y * (y + (x + 1.0)));
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 3d-13) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = x / (y * (y + (x + 1.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 3e-13) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = x / (y * (y + (x + 1.0)));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 3e-13:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = x / (y * (y + (x + 1.0)))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 3e-13)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(x / Float64(y * Float64(y + Float64(x + 1.0))));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 3e-13)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = x / (y * (y + (x + 1.0)));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 3e-13], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.99999999999999984e-13

    1. Initial program 67.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*71.5%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative71.5%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative71.5%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative71.5%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.3%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.3%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.3%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.3%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.3%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.3%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 62.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*61.6%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative61.6%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified61.6%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 2.99999999999999984e-13 < y

    1. Initial program 70.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/r*78.4%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative78.4%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative78.4%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative78.4%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/91.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative91.8%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/91.9%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg91.9%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative91.9%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative91.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg91.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative91.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+91.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified91.9%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 76.5%

      \[\leadsto \color{blue}{\frac{1}{y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    6. Step-by-step derivation
      1. expm1-log1p-u76.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{y} \cdot \frac{x}{x + \left(y + 1\right)}\right)\right)} \]
      2. expm1-udef60.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{y} \cdot \frac{x}{x + \left(y + 1\right)}\right)} - 1} \]
      3. frac-times60.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1 \cdot x}{y \cdot \left(x + \left(y + 1\right)\right)}}\right)} - 1 \]
      4. *-un-lft-identity60.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{x}}{y \cdot \left(x + \left(y + 1\right)\right)}\right)} - 1 \]
      5. associate-+r+60.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{y \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}}\right)} - 1 \]
      6. +-commutative60.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{y \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)}\right)} - 1 \]
      7. associate-+r+60.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{x}{y \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}}\right)} - 1 \]
    7. Applied egg-rr60.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def77.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\right)\right)} \]
      2. expm1-log1p77.7%

        \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}} \]
    9. Simplified77.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + \left(x + 1\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 62.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 2.5e+17) (/ y (* x (+ x 1.0))) (/ x (* y (+ y x)))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.5e+17) {
		tmp = y / (x * (x + 1.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) :: tmp
    if (y <= 2.5d+17) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = x / (y * (y + x))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.5e+17) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = x / (y * (y + x));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.5e+17:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = x / (y * (y + x))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.5e+17)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(x / Float64(y * Float64(y + x)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.5e+17)
		tmp = y / (x * (x + 1.0));
	else
		tmp = x / (y * (y + x));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.5e+17], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.5e17

    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*72.4%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative72.4%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative72.4%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative72.4%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.7%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.7%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.7%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.7%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.7%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 63.3%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]

    if 2.5e17 < y

    1. Initial program 67.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity67.6%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y\right)}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-+r+67.6%

        \[\leadsto \frac{1 \cdot \left(x \cdot y\right)}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      3. associate-*l*67.6%

        \[\leadsto \frac{1 \cdot \left(x \cdot y\right)}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)}} \]
      4. times-frac76.3%

        \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      5. associate-+r+76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      6. +-commutative76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      7. associate-+l+76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
    4. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}} \]
    5. Step-by-step derivation
      1. associate-/l*91.3%

        \[\leadsto \frac{1}{x + y} \cdot \color{blue}{\frac{x}{\frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
      2. frac-times88.4%

        \[\leadsto \color{blue}{\frac{1 \cdot x}{\left(x + y\right) \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
      3. *-un-lft-identity88.4%

        \[\leadsto \frac{\color{blue}{x}}{\left(x + y\right) \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
      4. +-commutative88.4%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
      5. +-commutative88.4%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \frac{\color{blue}{\left(y + x\right)} \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
    6. Applied egg-rr88.4%

      \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \frac{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
    7. Taylor expanded in y around inf 84.3%

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 63.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{+16}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 2.6e+16) (/ (/ y x) (+ x 1.0)) (/ x (* y (+ y x)))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.6e+16) {
		tmp = (y / x) / (x + 1.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) :: tmp
    if (y <= 2.6d+16) then
        tmp = (y / x) / (x + 1.0d0)
    else
        tmp = x / (y * (y + x))
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.6e+16) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = x / (y * (y + x));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.6e+16:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = x / (y * (y + x))
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.6e+16)
		tmp = Float64(Float64(y / x) / Float64(x + 1.0));
	else
		tmp = Float64(x / Float64(y * Float64(y + x)));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.6e+16)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = x / (y * (y + x));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.6e+16], N[(N[(y / x), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.6 \cdot 10^{+16}:\\
\;\;\;\;\frac{\frac{y}{x}}{x + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.6e16

    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*72.4%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative72.4%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative72.4%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative72.4%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/86.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative86.7%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/86.7%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg86.7%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative86.7%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+86.7%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified86.7%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 63.3%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*62.5%

        \[\leadsto \color{blue}{\frac{\frac{y}{x}}{1 + x}} \]
      2. +-commutative62.5%

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x + 1}} \]
    7. Simplified62.5%

      \[\leadsto \color{blue}{\frac{\frac{y}{x}}{x + 1}} \]

    if 2.6e16 < y

    1. Initial program 67.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity67.6%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y\right)}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. associate-+r+67.6%

        \[\leadsto \frac{1 \cdot \left(x \cdot y\right)}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
      3. associate-*l*67.6%

        \[\leadsto \frac{1 \cdot \left(x \cdot y\right)}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)}} \]
      4. times-frac76.3%

        \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      5. associate-+r+76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      6. +-commutative76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      7. associate-+l+76.3%

        \[\leadsto \frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}} \]
    4. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}} \]
    5. Step-by-step derivation
      1. associate-/l*91.3%

        \[\leadsto \frac{1}{x + y} \cdot \color{blue}{\frac{x}{\frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
      2. frac-times88.4%

        \[\leadsto \color{blue}{\frac{1 \cdot x}{\left(x + y\right) \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
      3. *-un-lft-identity88.4%

        \[\leadsto \frac{\color{blue}{x}}{\left(x + y\right) \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
      4. +-commutative88.4%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \frac{\left(x + y\right) \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
      5. +-commutative88.4%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \frac{\color{blue}{\left(y + x\right)} \cdot \left(y + \left(x + 1\right)\right)}{y}} \]
    6. Applied egg-rr88.4%

      \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \frac{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}{y}}} \]
    7. Taylor expanded in y around inf 84.3%

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.6 \cdot 10^{+16}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + x\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 33.4% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 2.7e-59) (/ y x) (/ x (+ y x))))
double code(double x, double y) {
	double tmp;
	if (y <= 2.7e-59) {
		tmp = y / x;
	} else {
		tmp = x / (y + x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.7d-59) then
        tmp = y / x
    else
        tmp = x / (y + x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.7e-59) {
		tmp = y / x;
	} else {
		tmp = x / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.7e-59:
		tmp = y / x
	else:
		tmp = x / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.7e-59)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / Float64(y + x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.7e-59)
		tmp = y / x;
	else
		tmp = x / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.7e-59], N[(y / x), $MachinePrecision], N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.6999999999999999e-59

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative85.6%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac66.6%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/79.0%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative79.0%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in57.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef51.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult51.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in66.6%

        \[\leadsto \frac{y \cdot x}{\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.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative66.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times85.5%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x + y}{y}}} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y} \]
      2. frac-times99.5%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot x}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
      3. *-un-lft-identity99.5%

        \[\leadsto \frac{\frac{\color{blue}{x}}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
      4. +-commutative99.5%

        \[\leadsto \frac{\frac{x}{\frac{\color{blue}{y + x}}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
    8. Applied egg-rr99.5%

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
    9. Taylor expanded in y around 0 62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    10. Step-by-step derivation
      1. +-commutative62.0%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    11. Simplified62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    12. Taylor expanded in x around 0 37.6%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 2.6999999999999999e-59 < y

    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-frac92.9%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative92.9%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative92.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative92.9%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac73.0%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/80.9%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative80.9%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative80.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in69.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def80.9%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative80.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative80.9%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult81.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative81.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified81.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/73.0%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef65.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult65.8%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in73.0%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. associate-+r+73.0%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative73.0%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times92.9%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.9%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.9%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Taylor expanded in y around 0 60.5%

      \[\leadsto \frac{\frac{y}{x + y} \cdot \color{blue}{\frac{x}{1 + x}}}{x + y} \]
    8. Step-by-step derivation
      1. +-commutative60.5%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{x + 1}}}{x + y} \]
    9. Simplified60.5%

      \[\leadsto \frac{\frac{y}{x + y} \cdot \color{blue}{\frac{x}{x + 1}}}{x + y} \]
    10. Taylor expanded in x around 0 33.4%

      \[\leadsto \frac{\color{blue}{x}}{x + y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.7 \cdot 10^{-59}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 33.3% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 2.45 \cdot 10^{-58}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 2.45e-58) (/ y x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (y <= 2.45e-58) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 2.45d-58) then
        tmp = y / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 2.45e-58) {
		tmp = y / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 2.45e-58:
		tmp = y / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 2.45e-58)
		tmp = Float64(y / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 2.45e-58)
		tmp = y / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 2.45e-58], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.45 \cdot 10^{-58}:\\
\;\;\;\;\frac{y}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 2.45000000000000015e-58

    1. Initial program 66.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. times-frac85.6%

        \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
      2. +-commutative85.6%

        \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
      3. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
      4. +-commutative85.6%

        \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
      5. times-frac66.6%

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      6. associate-*l/79.0%

        \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
      7. *-commutative79.0%

        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      8. *-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      9. distribute-rgt1-in57.5%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      10. fma-def79.0%

        \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      11. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      12. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      13. cube-unmult79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      14. +-commutative79.0%

        \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified79.0%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/66.7%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
      2. fma-udef51.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult51.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in66.6%

        \[\leadsto \frac{y \cdot x}{\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.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      6. *-commutative66.6%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      7. frac-times85.5%

        \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
      8. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
      9. associate-*l/99.8%

        \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
      10. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
      11. +-commutative99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
      12. associate-+l+99.8%

        \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
    7. Step-by-step derivation
      1. clear-num99.7%

        \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x + y}{y}}} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y} \]
      2. frac-times99.5%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot x}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
      3. *-un-lft-identity99.5%

        \[\leadsto \frac{\frac{\color{blue}{x}}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
      4. +-commutative99.5%

        \[\leadsto \frac{\frac{x}{\frac{\color{blue}{y + x}}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
    8. Applied egg-rr99.5%

      \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
    9. Taylor expanded in y around 0 62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    10. Step-by-step derivation
      1. +-commutative62.0%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    11. Simplified62.0%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]
    12. Taylor expanded in x around 0 37.6%

      \[\leadsto \color{blue}{\frac{y}{x}} \]

    if 2.45000000000000015e-58 < y

    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. associate-/r*81.0%

        \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
      2. *-commutative81.0%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      3. +-commutative81.0%

        \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
      4. +-commutative81.0%

        \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
      5. associate-*l/92.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
      6. +-commutative92.8%

        \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
      7. associate-*r/92.9%

        \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
      8. remove-double-neg92.9%

        \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
      9. +-commutative92.9%

        \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      10. +-commutative92.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
      11. remove-double-neg92.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
      12. +-commutative92.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
      13. associate-+l+92.9%

        \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
    3. Simplified92.9%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 69.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. +-commutative69.4%

        \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
    7. Simplified69.4%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
    8. Taylor expanded in y around 0 33.1%

      \[\leadsto \frac{x}{\color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification36.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.45 \cdot 10^{-58}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{0.5}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 0.5 x))
double code(double x, double y) {
	return 0.5 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 0.5d0 / x
end function
public static double code(double x, double y) {
	return 0.5 / x;
}
def code(x, y):
	return 0.5 / x
function code(x, y)
	return Float64(0.5 / x)
end
function tmp = code(x, y)
	tmp = 0.5 / x;
end
code[x_, y_] := N[(0.5 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{0.5}{x}
\end{array}
Derivation
  1. Initial program 68.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. times-frac87.9%

      \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
    2. +-commutative87.9%

      \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
    3. +-commutative87.9%

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
    4. +-commutative87.9%

      \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
    5. times-frac68.6%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
    6. associate-*l/79.6%

      \[\leadsto \color{blue}{\frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)} \cdot y} \]
    7. *-commutative79.6%

      \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
    8. *-commutative79.6%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    9. distribute-rgt1-in61.4%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    10. fma-def79.6%

      \[\leadsto y \cdot \frac{x}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
    11. +-commutative79.6%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    12. +-commutative79.6%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    13. cube-unmult79.6%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    14. +-commutative79.6%

      \[\leadsto y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified79.6%

    \[\leadsto \color{blue}{y \cdot \frac{x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/68.7%

      \[\leadsto \color{blue}{\frac{y \cdot x}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    2. fma-udef56.2%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult56.2%

      \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    4. distribute-rgt1-in68.6%

      \[\leadsto \frac{y \cdot x}{\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.6%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + \left(y + 1\right)\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
    6. *-commutative68.6%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. frac-times87.8%

      \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
    8. associate-/r*99.7%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y}}{x + y}} \cdot \frac{x}{x + \left(y + 1\right)} \]
    9. associate-*l/99.8%

      \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{x + \left(y + 1\right)}}{x + y}} \]
    10. associate-+r+99.8%

      \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(x + y\right) + 1}}}{x + y} \]
    11. +-commutative99.8%

      \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{\left(y + x\right)} + 1}}{x + y} \]
    12. associate-+l+99.8%

      \[\leadsto \frac{\frac{y}{x + y} \cdot \frac{x}{\color{blue}{y + \left(x + 1\right)}}}{x + y} \]
  6. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{\frac{y}{x + y} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y}} \]
  7. Step-by-step derivation
    1. clear-num99.7%

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{x + y}{y}}} \cdot \frac{x}{y + \left(x + 1\right)}}{x + y} \]
    2. frac-times99.5%

      \[\leadsto \frac{\color{blue}{\frac{1 \cdot x}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
    3. *-un-lft-identity99.5%

      \[\leadsto \frac{\frac{\color{blue}{x}}{\frac{x + y}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
    4. +-commutative99.5%

      \[\leadsto \frac{\frac{x}{\frac{\color{blue}{y + x}}{y} \cdot \left(y + \left(x + 1\right)\right)}}{x + y} \]
  8. Applied egg-rr99.5%

    \[\leadsto \frac{\color{blue}{\frac{x}{\frac{y + x}{y} \cdot \left(y + \left(x + 1\right)\right)}}}{x + y} \]
  9. Taylor expanded in y around -inf 50.7%

    \[\leadsto \frac{\frac{x}{\color{blue}{y + -1 \cdot \left(-1 \cdot x + -1 \cdot \left(1 + x\right)\right)}}}{x + y} \]
  10. Step-by-step derivation
    1. mul-1-neg50.7%

      \[\leadsto \frac{\frac{x}{y + \color{blue}{\left(-\left(-1 \cdot x + -1 \cdot \left(1 + x\right)\right)\right)}}}{x + y} \]
    2. unsub-neg50.7%

      \[\leadsto \frac{\frac{x}{\color{blue}{y - \left(-1 \cdot x + -1 \cdot \left(1 + x\right)\right)}}}{x + y} \]
    3. neg-mul-150.7%

      \[\leadsto \frac{\frac{x}{y - \left(\color{blue}{\left(-x\right)} + -1 \cdot \left(1 + x\right)\right)}}{x + y} \]
    4. distribute-lft-in50.7%

      \[\leadsto \frac{\frac{x}{y - \left(\left(-x\right) + \color{blue}{\left(-1 \cdot 1 + -1 \cdot x\right)}\right)}}{x + y} \]
    5. metadata-eval50.7%

      \[\leadsto \frac{\frac{x}{y - \left(\left(-x\right) + \left(\color{blue}{-1} + -1 \cdot x\right)\right)}}{x + y} \]
    6. neg-mul-150.7%

      \[\leadsto \frac{\frac{x}{y - \left(\left(-x\right) + \left(-1 + \color{blue}{\left(-x\right)}\right)\right)}}{x + y} \]
    7. associate-+r+50.7%

      \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\left(\left(-x\right) + -1\right) + \left(-x\right)\right)}}}{x + y} \]
    8. unsub-neg50.7%

      \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\left(\left(-x\right) + -1\right) - x\right)}}}{x + y} \]
    9. +-commutative50.7%

      \[\leadsto \frac{\frac{x}{y - \left(\color{blue}{\left(-1 + \left(-x\right)\right)} - x\right)}}{x + y} \]
    10. unsub-neg50.7%

      \[\leadsto \frac{\frac{x}{y - \left(\color{blue}{\left(-1 - x\right)} - x\right)}}{x + y} \]
  11. Simplified50.7%

    \[\leadsto \frac{\frac{x}{\color{blue}{y - \left(\left(-1 - x\right) - x\right)}}}{x + y} \]
  12. Taylor expanded in x around inf 4.2%

    \[\leadsto \color{blue}{\frac{0.5}{x}} \]
  13. Final simplification4.2%

    \[\leadsto \frac{0.5}{x} \]
  14. Add Preprocessing

Alternative 19: 26.7% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
	return x / y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / y
end function
public static double code(double x, double y) {
	return x / y;
}
def code(x, y):
	return x / y
function code(x, y)
	return Float64(x / y)
end
function tmp = code(x, y)
	tmp = x / y;
end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 68.6%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/r*73.4%

      \[\leadsto \color{blue}{\frac{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1}} \]
    2. *-commutative73.4%

      \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    3. +-commutative73.4%

      \[\leadsto \frac{\frac{y \cdot x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    4. +-commutative73.4%

      \[\leadsto \frac{\frac{y \cdot x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}}}{\left(x + y\right) + 1} \]
    5. associate-*l/87.8%

      \[\leadsto \frac{\color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}}{\left(x + y\right) + 1} \]
    6. +-commutative87.8%

      \[\leadsto \frac{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot x}{\color{blue}{\left(y + x\right)} + 1} \]
    7. associate-*r/87.8%

      \[\leadsto \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{x}{\left(y + x\right) + 1}} \]
    8. remove-double-neg87.8%

      \[\leadsto \frac{y}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{\color{blue}{-\left(-x\right)}}{\left(y + x\right) + 1} \]
    9. +-commutative87.8%

      \[\leadsto \frac{y}{\color{blue}{\left(x + y\right)} \cdot \left(y + x\right)} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
    10. +-commutative87.8%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \cdot \frac{-\left(-x\right)}{\left(y + x\right) + 1} \]
    11. remove-double-neg87.8%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{\color{blue}{x}}{\left(y + x\right) + 1} \]
    12. +-commutative87.8%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{\left(x + y\right)} + 1} \]
    13. associate-+l+87.8%

      \[\leadsto \frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{\color{blue}{x + \left(y + 1\right)}} \]
  3. Simplified87.8%

    \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{x}{x + \left(y + 1\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0 48.8%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  6. Step-by-step derivation
    1. +-commutative48.8%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
  7. Simplified48.8%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(y + 1\right)}} \]
  8. Taylor expanded in y around 0 24.7%

    \[\leadsto \frac{x}{\color{blue}{y}} \]
  9. Final simplification24.7%

    \[\leadsto \frac{x}{y} \]
  10. Add Preprocessing

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 2024020 
(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))))