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

Percentage Accurate: 68.4% → 99.8%
Time: 13.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 68.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.5% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 75.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. *-commutative75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000002e-271 < y < 1.12000000000000008e-6

    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. Step-by-step derivation
      1. associate-/l*79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.12000000000000008e-6 < y < 4.1599999999999999e99

    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. Step-by-step derivation
      1. associate-/l*85.4%

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

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

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

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

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

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

    if 4.1599999999999999e99 < y

    1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{y + x} \]
    16. Simplified86.5%

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

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

Alternative 3: 82.5% accurate, 0.6× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -1.30000000000000005e85 < x < -5.00000000000000018e-11

    1. Initial program 87.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-/l*87.6%

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

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

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

    if -5.00000000000000018e-11 < x

    1. Initial program 73.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-/l*83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 66.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000033e-5 < x < -5.8000000000000002e-162

    1. Initial program 82.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-/l*94.6%

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

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

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

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

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

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

    if -5.8000000000000002e-162 < x

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{y}{y + x}}{y + 1}}}{y + x} \]
    11. Simplified89.2%

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

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

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

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

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

Alternative 5: 64.7% accurate, 0.7× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

    if -2.65e67 < x < -3.5000000000000002e-161

    1. Initial program 84.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-/l*92.4%

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

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

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

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

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

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

    if -3.5000000000000002e-161 < x

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \frac{\color{blue}{\frac{\frac{y}{y + x}}{y + 1}}}{y + x} \]
    11. Simplified89.2%

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

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

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

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

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

Alternative 6: 80.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.65e-4 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0027000000000000001 < x

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.2% accurate, 1.1× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0500000000000001e-182 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.0% accurate, 1.4× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in y around 0 64.0%

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

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

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

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

    if -2.0500000000000001e-182 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.4% accurate, 1.4× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in y around 0 64.0%

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

    if -2.0500000000000001e-182 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 56.6% accurate, 1.4× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in y around 0 64.0%

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

    if -2.0500000000000001e-182 < x

    1. Initial program 72.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 57.8%

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

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

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

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

Alternative 12: 44.7% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

    if 2.39999999999999982e-127 < y

    1. Initial program 73.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. Taylor expanded in x around 0 54.3%

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

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

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

Alternative 13: 32.9% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

    if 7.20000000000000049e-128 < y

    1. Initial program 73.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-/l*84.8%

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

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

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

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

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

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

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

Alternative 14: 26.4% 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.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-/l*82.8%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  9. Add Preprocessing

Alternative 15: 3.6% accurate, 8.5× speedup?

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

\\
-x
\end{array}
Derivation
  1. Initial program 72.6%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x + \color{blue}{\left(-x \cdot y\right)}}{y} \]
    2. distribute-lft-neg-out14.3%

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

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

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

    \[\leadsto \color{blue}{-1 \cdot x} \]
  12. Step-by-step derivation
    1. mul-1-neg3.5%

      \[\leadsto \color{blue}{-x} \]
  13. Simplified3.5%

    \[\leadsto \color{blue}{-x} \]
  14. 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 2024111 
(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))))