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

Percentage Accurate: 68.9% → 99.8%
Time: 13.3s
Alternatives: 23
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 23 alternatives:

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified66.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. *-commutative66.7%

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult50.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-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-frac91.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+91.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-rr91.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. clear-num91.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
    3. log-div36.0%

      \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
    4. div-inv35.9%

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

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

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
    7. clear-num35.6%

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

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

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

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
    11. +-commutative35.6%

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
    12. log1p-undefine35.6%

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
  10. Applied egg-rr35.6%

    \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
  11. Step-by-step derivation
    1. exp-diff35.5%

      \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
    2. rem-exp-log57.3%

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
    4. associate-/r/57.3%

      \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
    5. log1p-undefine57.3%

      \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
    6. rem-exp-log99.8%

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

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

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

Alternative 2: 72.2% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
      3. log-div0.0%

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv0.0%

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

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

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

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log11.9%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/11.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine11.9%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

    if -3e-11 < x < -3.00000000000000026e-197

    1. Initial program 79.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. associate-/l*92.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+92.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. Simplified92.5%

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

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

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

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

    if -3.00000000000000026e-197 < x

    1. Initial program 66.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. +-commutative66.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. +-commutative66.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. +-commutative66.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. *-commutative66.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-in60.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-define66.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. +-commutative66.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. +-commutative66.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-unmult66.6%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult60.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-in66.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. *-commutative66.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*66.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-frac91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 66.7% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
      3. log-div0.0%

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv0.0%

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

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

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

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log11.9%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/11.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine11.9%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

    if -3.19999999999999994e-11 < x < -2.15e-197

    1. Initial program 79.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. associate-/l*92.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+92.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. Simplified92.5%

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

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

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

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

    if -2.15e-197 < x

    1. Initial program 66.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. +-commutative66.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. +-commutative66.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. +-commutative66.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. *-commutative66.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-in60.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-define66.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. +-commutative66.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. +-commutative66.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-unmult66.6%

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

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

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

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult60.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-in66.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. *-commutative66.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*66.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-frac91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv54.5%

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
      7. clear-num53.8%

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative53.8%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine53.8%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr53.8%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff53.7%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log74.9%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/74.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine74.9%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

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

Alternative 4: 65.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 59.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. +-commutative59.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. +-commutative59.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. +-commutative59.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. *-commutative59.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-in18.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-define59.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. +-commutative59.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. +-commutative59.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-unmult59.3%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified59.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. *-commutative59.3%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult18.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-in59.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. *-commutative59.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*59.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-frac87.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+87.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-rr87.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. clear-num87.7%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
      3. log-div0.0%

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv0.0%

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

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

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

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log10.2%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/10.2%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine10.2%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.9%

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

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

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

    if -8.4999999999999998e33 < x < -6.49999999999999997e-150

    1. Initial program 84.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. associate-/l*96.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+96.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. Simplified96.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 y around 0 71.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. +-commutative71.5%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified71.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 -6.49999999999999997e-150 < x

    1. Initial program 66.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. +-commutative66.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. +-commutative66.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. +-commutative66.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. *-commutative66.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-in59.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-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-define59.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult59.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-in66.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. *-commutative66.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*66.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-frac92.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv51.7%

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
      7. clear-num51.1%

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative51.1%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine51.1%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr51.1%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff51.0%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log74.0%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/73.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine73.9%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

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

Alternative 5: 95.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 69.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. +-commutative69.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. +-commutative69.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. +-commutative69.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. *-commutative69.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-in50.7%

        \[\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-define69.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. +-commutative69.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. +-commutative69.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-unmult69.8%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified69.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. *-commutative69.8%

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

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

        \[\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-in69.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. *-commutative69.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*69.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-frac95.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+95.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-rr95.1%

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

    if 7.00000000000000051e160 < y

    1. Initial program 49.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. +-commutative49.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. +-commutative49.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. +-commutative49.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. *-commutative49.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-in49.7%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified49.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. *-commutative49.7%

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

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

        \[\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-in49.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. *-commutative49.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*49.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-frac72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.8% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
      3. log-div0.0%

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv0.0%

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

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

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

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine0.0%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr0.0%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff0.0%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log11.9%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/11.9%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine11.9%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

    if -3.19999999999999994e-11 < x

    1. Initial program 68.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. +-commutative68.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. +-commutative68.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. +-commutative68.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. *-commutative68.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-in60.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-define68.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. +-commutative68.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. +-commutative68.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-unmult68.7%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified68.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. *-commutative68.7%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult60.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-in68.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. *-commutative68.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*68.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.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. clear-num93.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv49.5%

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
      7. clear-num48.9%

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative48.9%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine48.9%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr48.9%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff48.8%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log74.4%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/74.3%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine74.3%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

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

Alternative 7: 84.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 68.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. +-commutative68.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. +-commutative68.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. +-commutative68.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. *-commutative68.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-in46.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-define68.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. +-commutative68.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. +-commutative68.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-unmult68.1%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified68.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. *-commutative68.1%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult46.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-in68.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. *-commutative68.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*68.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-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. Step-by-step derivation
      1. clear-num95.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv25.2%

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
      7. clear-num24.7%

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative24.7%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine24.7%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr24.7%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff24.7%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log46.4%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/46.4%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine46.4%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.8%

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

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

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

    if 5.5999999999999998e-17 < y

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in59.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-define63.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult59.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-in63.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. *-commutative63.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*63.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-frac82.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+82.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-rr82.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. clear-num82.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 84.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 68.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. +-commutative68.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. +-commutative68.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. +-commutative68.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. *-commutative68.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-in46.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-define68.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. +-commutative68.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. +-commutative68.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-unmult68.1%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified68.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. *-commutative68.1%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult46.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-in68.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. *-commutative68.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*68.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-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. Step-by-step derivation
      1. clear-num95.2%

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

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

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

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

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

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

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

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

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

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

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

    if 5.5999999999999998e-17 < y

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in59.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-define63.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult59.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-in63.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. *-commutative63.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*63.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-frac82.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+82.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-rr82.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. clear-num82.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 99.3% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified66.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. *-commutative66.7%

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult50.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-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-frac91.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+91.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-rr91.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. clear-num91.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 99.3% accurate, 1.0× speedup?

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified66.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. *-commutative66.7%

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult50.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-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-frac91.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+91.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-rr91.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. clear-num91.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto e^{\log \color{blue}{\left(\frac{\frac{\frac{x}{y + x}}{\frac{y + x}{y}}}{x + \left(y + 1\right)}\right)}} \]
    3. log-div36.0%

      \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
    4. div-inv35.9%

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

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

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
    7. clear-num35.6%

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

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

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

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
    11. +-commutative35.6%

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
    12. log1p-undefine35.6%

      \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
  10. Applied egg-rr35.6%

    \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
  11. Step-by-step derivation
    1. exp-diff35.5%

      \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
    2. rem-exp-log57.3%

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

      \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
    4. associate-/r/57.3%

      \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
    5. log1p-undefine57.3%

      \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
    6. rem-exp-log99.8%

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

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

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

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

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

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

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

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

Alternative 11: 61.8% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in27.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.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult27.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.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. *-commutative63.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*63.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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\color{blue}{\log \left(\frac{\frac{x}{y + x}}{\frac{y + x}{y}}\right) - \log \left(x + \left(y + 1\right)\right)}} \]
      4. div-inv4.9%

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{1}{\frac{\color{blue}{x + y}}{y}}\right) - \log \left(x + \left(y + 1\right)\right)} \]
      7. clear-num4.9%

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

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

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

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \color{blue}{\left(1 + \left(y + x\right)\right)}} \]
      11. +-commutative4.9%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \log \left(1 + \color{blue}{\left(x + y\right)}\right)} \]
      12. log1p-undefine4.9%

        \[\leadsto e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \color{blue}{\mathsf{log1p}\left(x + y\right)}} \]
    10. Applied egg-rr4.9%

      \[\leadsto \color{blue}{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right) - \mathsf{log1p}\left(x + y\right)}} \]
    11. Step-by-step derivation
      1. exp-diff4.9%

        \[\leadsto \color{blue}{\frac{e^{\log \left(\frac{x}{x + y} \cdot \frac{y}{x + y}\right)}}{e^{\mathsf{log1p}\left(x + y\right)}}} \]
      2. rem-exp-log16.2%

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{x}{x + y} \cdot y}{x + y}}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      4. associate-/r/16.2%

        \[\leadsto \frac{\frac{\color{blue}{\frac{x}{\frac{x + y}{y}}}}{x + y}}{e^{\mathsf{log1p}\left(x + y\right)}} \]
      5. log1p-undefine16.2%

        \[\leadsto \frac{\frac{\frac{x}{\frac{x + y}{y}}}{x + y}}{e^{\color{blue}{\log \left(1 + \left(x + y\right)\right)}}} \]
      6. rem-exp-log99.9%

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

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

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

    if -4.4000000000000002e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

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

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

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

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

Alternative 12: 61.6% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in27.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.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult27.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.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. *-commutative63.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*63.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.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot \frac{1}{x + 1}}{x + y}} \]
      2. un-div-inv71.4%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]
    11. Applied egg-rr71.4%

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

    if -4.4000000000000002e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

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

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

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

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

Alternative 13: 61.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in27.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.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult27.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.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. *-commutative63.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*63.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.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y \cdot \frac{1}{x + 1}}{x + y}} \]
      2. un-div-inv71.4%

        \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{x + y} \]
    11. Applied egg-rr71.4%

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

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

    if -2.8000000000000001e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

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

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

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

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

Alternative 14: 61.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.2%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in27.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.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. +-commutative63.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. +-commutative63.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-unmult63.2%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.2%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult27.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.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. *-commutative63.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*63.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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7500000000000001e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

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

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

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

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

Alternative 15: 60.9% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

    if -4.4000000000000002e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

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

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

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

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

Alternative 16: 60.2% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

    if -3.59999999999999999e-67 < x

    1. Initial program 68.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.4%

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

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

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

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

Alternative 17: 31.5% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{x - x \cdot y}}{y} \]
    10. Simplified20.4%

      \[\leadsto \color{blue}{\frac{x - x \cdot y}{y}} \]
    11. Taylor expanded in x around 0 20.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{x \cdot 1 - x \cdot y}}{y} \]
      5. *-rgt-identity20.4%

        \[\leadsto \frac{\color{blue}{x} - x \cdot y}{y} \]
      6. div-sub20.4%

        \[\leadsto \color{blue}{\frac{x}{y} - \frac{x \cdot y}{y}} \]
      7. associate-/l*20.5%

        \[\leadsto \frac{x}{y} - \color{blue}{x \cdot \frac{y}{y}} \]
      8. *-inverses20.5%

        \[\leadsto \frac{x}{y} - x \cdot \color{blue}{1} \]
      9. *-rgt-identity20.5%

        \[\leadsto \frac{x}{y} - \color{blue}{x} \]
    13. Simplified20.5%

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

    if 0.75 < y

    1. Initial program 59.5%

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

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

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

Alternative 18: 26.7% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x + 1}\\

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{1 + x}} \]
    11. Step-by-step derivation
      1. +-commutative6.4%

        \[\leadsto \frac{1}{\color{blue}{x + 1}} \]
    12. Simplified6.4%

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

    if -3.19999999999999994e-11 < x

    1. Initial program 68.6%

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

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

      \[\leadsto \color{blue}{\frac{x}{y}} \]
    7. Step-by-step derivation
      1. clear-num36.5%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
    10. Simplified36.5%

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

Alternative 19: 26.4% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{x + 1}\\

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{1 + x}} \]
    11. Step-by-step derivation
      1. +-commutative6.4%

        \[\leadsto \frac{1}{\color{blue}{x + 1}} \]
    12. Simplified6.4%

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

    if -3.19999999999999994e-11 < x

    1. Initial program 68.6%

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

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

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

Alternative 20: 26.4% accurate, 2.1× speedup?

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

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

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


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

    1. Initial program 61.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. +-commutative61.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. +-commutative61.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. +-commutative61.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. *-commutative61.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-in24.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-define61.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. +-commutative61.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. +-commutative61.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-unmult61.4%

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

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified61.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. *-commutative61.4%

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

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult24.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-in61.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. *-commutative61.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*61.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-frac87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3800 < x

    1. Initial program 68.6%

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

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

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

Alternative 21: 47.9% accurate, 2.4× speedup?

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

\\
\frac{x}{y \cdot \left(1 + y\right)}
\end{array}
Derivation
  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. associate-/l*81.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+81.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. Simplified81.5%

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

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

Alternative 22: 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 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-in50.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-define66.7%

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified66.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. *-commutative66.7%

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

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult50.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-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-frac91.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+91.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-rr91.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. clear-num91.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 23: 3.5% accurate, 8.5× speedup?

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

\\
-x
\end{array}
Derivation
  1. Initial program 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. associate-/l*81.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+81.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. Simplified81.5%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{x - x \cdot y}}{y} \]
  10. Simplified15.8%

    \[\leadsto \color{blue}{\frac{x - x \cdot y}{y}} \]
  11. Taylor expanded in y around inf 3.4%

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

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

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