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

Percentage Accurate: 69.3% → 99.7%
Time: 46.0s
Alternatives: 19
Speedup: 0.9×

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: 69.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.7% accurate, 0.9× speedup?

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

\\
\frac{1}{y + x} \cdot \left(\frac{y}{y + \left(1 + x\right)} \cdot \frac{x}{y + x}\right)
\end{array}
Derivation
  1. Initial program 72.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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-+r+72.0%

      \[\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. *-un-lft-identity72.0%

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

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

      \[\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. +-commutative78.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{y + x}\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+97}:\\
\;\;\;\;\frac{\frac{t\_0}{\frac{y + x}{x}}}{\frac{x}{y}}\\

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

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


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

    1. Initial program 65.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+65.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.54999999999999991e97 < x < -1.5e-32

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5e-32 < x

    1. Initial program 72.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+72.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. *-un-lft-identity72.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(x + \left(y + 1\right)\right)} \]
      3. associate-*l*72.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-frac78.2%

        \[\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. +-commutative78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 64.7% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+157}:\\
\;\;\;\;x \cdot \frac{\frac{1}{t\_0}}{y + x}\\

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


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

    1. Initial program 70.8%

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

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

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

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

        \[\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. +-commutative75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e-145 < y < 3.1999999999999999e157

    1. Initial program 77.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+77.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. *-un-lft-identity77.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(x + \left(y + 1\right)\right)} \]
      3. associate-*l*77.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-frac89.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. +-commutative89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e157 < y

    1. Initial program 63.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*63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 64.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{y + x}\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{-145}:\\
\;\;\;\;t\_0 \cdot \frac{y}{1 + x}\\

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

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


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

    1. Initial program 70.8%

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

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

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

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

        \[\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. +-commutative75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e-145 < y < 8.4999999999999998e157

    1. Initial program 77.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+77.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. *-un-lft-identity77.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(x + \left(y + 1\right)\right)} \]
      3. associate-*l*77.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-frac89.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. +-commutative89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999998e157 < y

    1. Initial program 63.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+63.2%

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

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

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

        \[\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. +-commutative63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 65.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{1}{y + x}\\
t_1 := y + \left(1 + x\right)\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{-145}:\\
\;\;\;\;t\_0 \cdot \frac{y}{t\_1}\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+157}:\\
\;\;\;\;x \cdot \frac{\frac{1}{t\_1}}{y + x}\\

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


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

    1. Initial program 70.8%

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

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

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

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

        \[\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. +-commutative75.4%

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

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

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e-145 < y < 4.3e157

    1. Initial program 77.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+77.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. *-un-lft-identity77.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(x + \left(y + 1\right)\right)} \]
      3. associate-*l*77.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-frac89.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. +-commutative89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.3e157 < y

    1. Initial program 63.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+63.2%

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

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

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

        \[\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. +-commutative63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 94.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+72.9%

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

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

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

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

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

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

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

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

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

    if 2.60000000000000011e157 < y

    1. Initial program 63.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+63.2%

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

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

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

        \[\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. +-commutative63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 94.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+72.9%

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

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

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

        \[\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. +-commutative79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.60000000000000011e157 < y

    1. Initial program 63.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+63.2%

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

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

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

        \[\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. +-commutative63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.3% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 65.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6e11 < x

    1. Initial program 73.8%

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

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

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

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

        \[\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. +-commutative79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 83.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{y + x}{x}\\
\mathbf{if}\;x \leq -7000000000:\\
\;\;\;\;\frac{\frac{\frac{1}{y + x}}{t\_0}}{\frac{x}{y}}\\

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


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

    1. Initial program 65.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7e9 < x

    1. Initial program 73.8%

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

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

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

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

        \[\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. +-commutative79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 44.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.8000000000000001e-154

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e-154 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-154}:\\ \;\;\;\;y \cdot \frac{1}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 57.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.8000000000000001e-154

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e-154 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 62.3% accurate, 1.1× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-+r+72.2%

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

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

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

        \[\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. +-commutative76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7499999999999999e-56 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 61.5% accurate, 1.2× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.09999999999999987e-56 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 43.7% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{1}{x} \cdot \frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 60.5% accurate, 1.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.49999999999999999e-56 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 61.3% accurate, 1.4× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.4499999999999998e-56 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 26.2% accurate, 3.4× speedup?

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

\\
\frac{x}{y + x}
\end{array}
Derivation
  1. Initial program 72.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. Add Preprocessing
  3. Step-by-step derivation
    1. associate-+r+72.0%

      \[\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. *-un-lft-identity72.0%

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

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

      \[\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. +-commutative78.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{y + x} \cdot x + 0} \]
    2. associate-*l/29.3%

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

      \[\leadsto \frac{\color{blue}{x}}{y + x} + 0 \]
  12. Applied egg-rr29.3%

    \[\leadsto \color{blue}{\frac{x}{y + x} + 0} \]
  13. Step-by-step derivation
    1. add029.3%

      \[\leadsto \color{blue}{\frac{x}{y + x}} \]
  14. Simplified29.3%

    \[\leadsto \color{blue}{\frac{x}{y + x}} \]
  15. Final simplification29.3%

    \[\leadsto \frac{x}{y + x} \]
  16. Add Preprocessing

Alternative 18: 4.2% accurate, 5.7× speedup?

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

\\
\frac{1}{y}
\end{array}
Derivation
  1. Initial program 72.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*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{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    3. +-commutative78.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  7. Final simplification4.0%

    \[\leadsto \frac{1}{y} \]
  8. Add Preprocessing

Alternative 19: 25.9% 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 72.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*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{x \cdot y}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)}}{\left(x + y\right) + 1} \]
    3. +-commutative78.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{x}{\color{blue}{y}} \]
  7. Final simplification28.9%

    \[\leadsto \frac{x}{y} \]
  8. 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 2024046 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))