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

Percentage Accurate: 69.6% → 99.2%
Time: 14.6s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 69.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.2% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 76.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x}\\

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

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

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


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

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{x}}}{y + x} \]
      9. *-inverses85.5%

        \[\leadsto \frac{\frac{y}{y + x} \cdot \color{blue}{1}}{y + x} \]
      10. *-rgt-identity85.5%

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

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

    if -4.2e82 < x < -1.7500000000000001e-14

    1. Initial program 88.8%

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

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

    if -1.7500000000000001e-14 < x < 1.4e-14

    1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e-14 < x

    1. Initial program 71.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. associate-*l*71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 76.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{y + x}\\

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

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


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

    1. Initial program 58.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{x}}}{y + x} \]
      9. *-inverses85.5%

        \[\leadsto \frac{\frac{y}{y + x} \cdot \color{blue}{1}}{y + x} \]
      10. *-rgt-identity85.5%

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

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

    if -5.1999999999999997e82 < x < 5.8e-49

    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*85.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+85.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. Simplified85.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. Step-by-step derivation
      1. *-un-lft-identity85.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8e-49 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 74.7% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 67.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. associate-*l*67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00160000000000000008 < x < 1.4e-14

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e-14 < x

    1. Initial program 71.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. associate-*l*71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 72.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 67.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. associate-*l*67.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.00145 < x < 6.39999999999999962e-105

    1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.39999999999999962e-105 < x

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 75.3% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

    if 6.39999999999999962e-105 < x

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.0% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4e-14 < x

    1. Initial program 71.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. associate-*l*71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 60.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -1.45000000000000001e-111

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000001e-111 < x

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

Alternative 9: 61.3% accurate, 1.2× speedup?

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

    1. Initial program 71.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. associate-*l*71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000001e-111 < x

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 43.9% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;x \leq -2.85 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x}\\

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


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

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -2.85e-201

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.85e-201 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

Alternative 11: 60.7% accurate, 1.4× speedup?

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

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

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

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

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

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

    if 2.19999999999999986e-82 < y

    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. Step-by-step derivation
      1. associate-/l*84.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+84.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. Simplified84.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 67.5%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.2 \cdot 10^{-82}:\\ \;\;\;\;\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: 61.4% accurate, 1.4× speedup?

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

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

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

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

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

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

    if 1.14999999999999998e-82 < y

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 61.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{-112}:\\ \;\;\;\;\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-112) (/ (/ y x) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= -8e-112) {
		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-112)) 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-112) {
		tmp = (y / x) / (x + 1.0);
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -8e-112:
		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-112)
		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-112)
		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-112], 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^{-112}:\\
\;\;\;\;\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 < -7.9999999999999996e-112

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

    if -7.9999999999999996e-112 < x

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 32.6% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.05000000000000013e-201 < x

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

Alternative 15: 4.1% accurate, 5.7× speedup?

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

\\
\frac{1}{y}
\end{array}
Derivation
  1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{y}} \]
  7. Final simplification4.0%

    \[\leadsto \frac{1}{y} \]
  8. Add Preprocessing

Alternative 16: 26.2% 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 71.6%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  9. Final simplification26.0%

    \[\leadsto \frac{x}{y} \]
  10. Add Preprocessing

Alternative 17: 3.5% accurate, 17.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1} \]
  9. Final simplification3.5%

    \[\leadsto 1 \]
  10. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

?
herbie shell --seed 2024084 
(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))))