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

Percentage Accurate: 69.9% → 99.8%
Time: 13.9s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 69.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 64.8% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5999999999999998e85 < x < -1.1e-159

    1. Initial program 81.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*90.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+90.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. Simplified90.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 y around 0 74.5%

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

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

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

    if -1.1e-159 < x

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

Alternative 3: 94.2% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 63.3%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      7. +-commutative63.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.80000000000000012e167 < y

    1. Initial program 47.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. +-commutative47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 62.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. +-commutative62.4%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      7. +-commutative62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999975e-230 < y < 1.3000000000000001e167

    1. Initial program 64.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. +-commutative64.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3000000000000001e167 < y

    1. Initial program 47.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. +-commutative47.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 54.6% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq -2 \cdot 10^{-142} \lor \neg \left(x \leq 7.2 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


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

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e5 < x < -2.0000000000000001e-142 or 7.2e-102 < x

    1. Initial program 62.0%

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

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

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

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

    if -2.0000000000000001e-142 < x < 7.2e-102

    1. Initial program 59.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*76.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+76.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. Simplified76.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 84.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -850000:\\ \;\;\;\;\frac{y}{x} \cdot \frac{1}{x}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-142} \lor \neg \left(x \leq 7.2 \cdot 10^{-102}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.7% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6499999999999998e55 < y

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 62.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. +-commutative62.4%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      7. +-commutative62.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999975e-230 < y < 1.01999999999999992e41

    1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.01999999999999992e41 < y

    1. Initial program 47.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. +-commutative47.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 63.5% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 68.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. +-commutative68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1000000000000001e-171 < x

    1. Initial program 56.3%

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

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

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

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

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

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

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

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

Alternative 9: 60.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.55 \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.55e-111) (/ (/ y (+ y x)) (+ x 1.0)) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (x <= -1.55e-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.55d-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.55e-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.55e-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.55e-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.55e-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.55e-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.55 \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.55000000000000007e-111

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000007e-111 < x

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.55 \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: 60.3% accurate, 1.4× speedup?

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

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000004e-111 < x

    1. Initial program 58.3%

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

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

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

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

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

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

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

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

Alternative 11: 62.2% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e5 < x

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

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

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

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

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

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

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

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

Alternative 12: 61.6% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.2e5 < x

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

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

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

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

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

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

Alternative 13: 36.8% accurate, 1.7× speedup?

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

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

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


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

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

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

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

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

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

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

    if 1 < y

    1. Initial program 48.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*76.0%

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

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

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

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

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

Alternative 14: 27.3% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
    12. Taylor expanded in y around inf 5.5%

      \[\leadsto \color{blue}{\frac{1}{x}} \]

    if -118000 < x

    1. Initial program 61.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*79.2%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.2%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.2%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 61.2%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Taylor expanded in y around 0 39.0%

      \[\leadsto \color{blue}{\frac{x}{y}} \]
    7. Step-by-step derivation
      1. clear-num40.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
      2. inv-pow40.3%

        \[\leadsto \color{blue}{{\left(\frac{y}{x}\right)}^{-1}} \]
    8. Applied egg-rr40.3%

      \[\leadsto \color{blue}{{\left(\frac{y}{x}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-140.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
    10. Simplified40.3%

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 26.9% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4600:\\ \;\;\;\;\frac{1}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= x -4600.0) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
	double tmp;
	if (x <= -4600.0) {
		tmp = 1.0 / 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 <= (-4600.0d0)) then
        tmp = 1.0d0 / x
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -4600.0) {
		tmp = 1.0 / x;
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -4600.0:
		tmp = 1.0 / x
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -4600.0)
		tmp = Float64(1.0 / x);
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -4600.0)
		tmp = 1.0 / x;
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -4600.0], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4600:\\
\;\;\;\;\frac{1}{x}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4600

    1. Initial program 61.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      3. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      4. *-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      5. distribute-rgt1-in34.9%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define61.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      7. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      8. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      9. cube-unmult61.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      10. +-commutative61.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.5%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define34.9%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult34.9%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in61.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. *-commutative61.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      6. associate-*l*61.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      7. times-frac91.2%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      8. associate-+r+91.2%

        \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    6. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. div-inv91.1%

        \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\left(x \cdot \frac{1}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\right)} \]
      2. +-commutative91.1%

        \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\color{blue}{\left(y + x\right)} \cdot \left(x + \left(y + 1\right)\right)}\right) \]
      3. +-commutative91.1%

        \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \left(x + \color{blue}{\left(1 + y\right)}\right)}\right) \]
      4. associate-+l+91.1%

        \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + 1\right) + y\right)}}\right) \]
      5. +-commutative91.1%

        \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}}\right) \]
    8. Applied egg-rr91.1%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\left(x \cdot \frac{1}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/91.2%

        \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{x \cdot 1}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}} \]
      2. *-rgt-identity91.2%

        \[\leadsto \frac{y}{x + y} \cdot \frac{\color{blue}{x}}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)} \]
      3. associate-/r*99.8%

        \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}} \]
    10. Simplified99.8%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}} \]
    11. Taylor expanded in x around inf 73.6%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
    12. Taylor expanded in y around inf 5.5%

      \[\leadsto \color{blue}{\frac{1}{x}} \]

    if -4600 < x

    1. Initial program 61.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*79.2%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.2%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.2%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 61.2%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Taylor expanded in y around 0 39.0%

      \[\leadsto \color{blue}{\frac{x}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 16: 4.2% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{1}{x} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
	return 1.0 / x;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / x
end function
public static double code(double x, double y) {
	return 1.0 / x;
}
def code(x, y):
	return 1.0 / x
function code(x, y)
	return Float64(1.0 / x)
end
function tmp = code(x, y)
	tmp = 1.0 / x;
end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{x}
\end{array}
Derivation
  1. Initial program 61.2%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    3. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
    4. *-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    5. distribute-rgt1-in47.5%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    6. fma-define61.2%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
    7. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    8. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    9. cube-unmult61.2%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    10. +-commutative61.2%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified61.2%

    \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative61.2%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
    2. fma-define47.5%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult47.5%

      \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    4. distribute-rgt1-in61.2%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    5. *-commutative61.2%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    6. associate-*l*61.2%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
    7. times-frac92.6%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    8. associate-+r+92.6%

      \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
  6. Applied egg-rr92.6%

    \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
  7. Step-by-step derivation
    1. div-inv92.5%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\left(x \cdot \frac{1}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}\right)} \]
    2. +-commutative92.5%

      \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\color{blue}{\left(y + x\right)} \cdot \left(x + \left(y + 1\right)\right)}\right) \]
    3. +-commutative92.5%

      \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \left(x + \color{blue}{\left(1 + y\right)}\right)}\right) \]
    4. associate-+l+92.5%

      \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + 1\right) + y\right)}}\right) \]
    5. +-commutative92.5%

      \[\leadsto \frac{y}{x + y} \cdot \left(x \cdot \frac{1}{\left(y + x\right) \cdot \color{blue}{\left(y + \left(x + 1\right)\right)}}\right) \]
  8. Applied egg-rr92.5%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\left(x \cdot \frac{1}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}\right)} \]
  9. Step-by-step derivation
    1. associate-*r/92.6%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{x \cdot 1}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)}} \]
    2. *-rgt-identity92.6%

      \[\leadsto \frac{y}{x + y} \cdot \frac{\color{blue}{x}}{\left(y + x\right) \cdot \left(y + \left(x + 1\right)\right)} \]
    3. associate-/r*99.8%

      \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}} \]
  10. Simplified99.8%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{\frac{x}{y + x}}{y + \left(x + 1\right)}} \]
  11. Taylor expanded in x around inf 37.8%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x}} \]
  12. Taylor expanded in y around inf 4.4%

    \[\leadsto \color{blue}{\frac{1}{x}} \]
  13. Add Preprocessing

Developer Target 1: 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 2024145 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))