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

Percentage Accurate: 68.6% → 99.8%
Time: 19.1s
Alternatives: 16
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 16 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.6% 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{y}{y + x} \cdot \frac{\frac{x}{y + x}}{y + \left(x + 1\right)} \end{array} \]
(FPCore (x y)
 :precision binary64
 (* (/ y (+ y x)) (/ (/ x (+ y x)) (+ y (+ x 1.0)))))
double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0d0)))
end function
public static double code(double x, double y) {
	return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
}
def code(x, y):
	return (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)))
function code(x, y)
	return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + 1.0))))
end
function tmp = code(x, y)
	tmp = (y / (y + x)) * ((x / (y + x)) / (y + (x + 1.0)));
end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{y}{y + x} \cdot \frac{\frac{x}{y + x}}{y + \left(x + 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. associate-*l*72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 65.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-82}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.34999999999999994e-111 or 3.2000000000000001e-82 < y < 1.9500000000000001e-42

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

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

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

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

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

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

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

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

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

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

    if 1.34999999999999994e-111 < y < 3.2000000000000001e-82 or 1.9500000000000001e-42 < y < 1.24999999999999993e165

    1. Initial program 74.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative74.3%

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999993e165 < y

    1. Initial program 54.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. Step-by-step derivation
      1. *-commutative54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.35 \cdot 10^{-111}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{-42}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 5.6 \cdot 10^{-82}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.8 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.26 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 1.2e-112 or 5.60000000000000049e-82 < y < 2.79999999999999998e-42

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

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

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

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

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

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

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

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

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

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

    if 1.2e-112 < y < 5.60000000000000049e-82 or 2.79999999999999998e-42 < y < 1.25999999999999999e165

    1. Initial program 74.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. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative74.3%

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

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

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

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

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

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

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

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

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

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

    if 1.25999999999999999e165 < y

    1. Initial program 54.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. Step-by-step derivation
      1. *-commutative54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.2 \cdot 10^{-112}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{-82}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-42}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{1}{x + 1}\\ \mathbf{elif}\;y \leq 1.26 \cdot 10^{+165}:\\ \;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + x}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 94.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

    if 2.59999999999999979e149 < y

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.3% accurate, 0.8× speedup?

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

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

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


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

    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. Taylor expanded in x around inf 65.6%

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

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

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

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

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

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

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

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

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

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

    if 1.5e-6 < y

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 81.5% accurate, 0.8× speedup?

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

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

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


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

    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. Taylor expanded in x around inf 65.6%

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

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

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

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

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

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

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

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

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

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

    if 3.1e-6 < y

    1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 58.8% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 58.7% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 72.9%

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

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

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

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

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

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 58.4% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\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 -8e-184) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= -8e-184) {
		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 <= (-8d-184)) 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 <= -8e-184) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -8e-184:
		tmp = (y / x) / (x + 1.0)
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -8e-184)
		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 <= -8e-184)
		tmp = (y / x) / (x + 1.0);
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\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 < -8.0000000000000005e-184

    1. Initial program 72.9%

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

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

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

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

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

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 57.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\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 -8e-184) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= -8e-184) {
		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 <= (-8d-184)) 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 <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / y) / (y + 1.0)
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -8e-184)
		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 <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / y) / (y + 1.0);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\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 < -8.0000000000000005e-184

    1. Initial program 72.9%

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

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

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 56.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\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 -8e-184) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0)))))
double code(double x, double y) {
	double tmp;
	if (x <= -8e-184) {
		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 <= (-8d-184)) 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 <= -8e-184) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = x / (y * (y + 1.0));
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -8e-184:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = x / (y * (y + 1.0))
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -8e-184)
		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 <= -8e-184)
		tmp = y / (x * (x + 1.0));
	else
		tmp = x / (y * (y + 1.0));
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -8e-184], 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 -8 \cdot 10^{-184}:\\
\;\;\;\;\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 < -8.0000000000000005e-184

    1. Initial program 72.9%

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

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

    if -8.0000000000000005e-184 < x

    1. Initial program 72.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-184}:\\ \;\;\;\;\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: 49.3% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 74.9%

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

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

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

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

    if 2.0500000000000001e165 < y

    1. Initial program 54.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. Step-by-step derivation
      1. *-commutative54.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 37.8% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

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

    if 1 < y

    1. Initial program 64.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. *-commutative64.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. associate-*l*64.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 26.4% accurate, 3.4× speedup?

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

\\
\frac{1}{\frac{y}{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*83.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+83.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. Simplified83.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 48.4%

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  9. Step-by-step derivation
    1. clear-num23.2%

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

      \[\leadsto \color{blue}{{\left(\frac{y}{x}\right)}^{-1}} \]
  10. Applied egg-rr23.2%

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

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
  12. Simplified23.2%

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

Alternative 15: 26.1% 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*83.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+83.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. Simplified83.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 48.4%

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

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

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

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

Alternative 16: 4.2% accurate, 5.7× speedup?

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

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 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. associate-*l*72.6%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{y}{y + x} \cdot \color{blue}{\frac{1}{x}} \]
  6. Taylor expanded in y around inf 4.3%

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