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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    5. distribute-rgt1-in52.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-define71.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    3. distribute-rgt1-in71.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 68.3% accurate, 0.6× speedup?

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

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

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

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

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


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

    1. Initial program 75.5%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define75.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. +-commutative75.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. +-commutative75.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-unmult75.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in75.5%

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

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

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

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

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

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

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

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

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

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

    if 3.80000000000000018e-165 < y < 4.1000000000000001e-11

    1. Initial program 88.8%

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

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

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

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

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

    if 4.1000000000000001e-11 < y < 4.9999999999999996e158

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define62.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. +-commutative62.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. +-commutative62.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-unmult62.2%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in62.2%

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

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

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

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

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

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

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

    if 4.9999999999999996e158 < y

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 82.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{y}{\left(x + y\right) \cdot t\_0}\\

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


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

    1. Initial program 77.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. +-commutative77.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. +-commutative77.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. +-commutative77.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. *-commutative77.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-in51.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-define77.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. +-commutative77.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. +-commutative77.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-unmult77.1%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.9999999999999999e-11 < y < 3.4000000000000003e160

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define62.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. +-commutative62.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. +-commutative62.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-unmult62.2%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in62.2%

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

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

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

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

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

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

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

    if 3.4000000000000003e160 < y

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 82.9% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 77.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. +-commutative77.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. +-commutative77.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. +-commutative77.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. *-commutative77.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-in51.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-define77.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. +-commutative77.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. +-commutative77.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-unmult77.1%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8e-11 < y < 4.9999999999999996e158

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define62.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. +-commutative62.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. +-commutative62.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-unmult62.2%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in62.2%

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

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

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

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

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

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

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

    if 4.9999999999999996e158 < y

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in55.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 66.0% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq 6 \cdot 10^{-8}:\\
\;\;\;\;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}}{y + 1}\\


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

    1. Initial program 75.5%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define75.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. +-commutative75.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. +-commutative75.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-unmult75.5%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in75.5%

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000013e-165 < y < 5.99999999999999946e-8

    1. Initial program 89.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*88.9%

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

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

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

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

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

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

    if 5.99999999999999946e-8 < y

    1. Initial program 58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.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-in55.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define58.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. +-commutative58.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. +-commutative58.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-unmult58.6%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-165}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + 1}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-8}:\\ \;\;\;\;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}}{y + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 64.5% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 76.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. +-commutative76.3%

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      5. distribute-rgt1-in50.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-define76.3%

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in76.3%

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

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

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

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

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

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

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

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

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

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

    if 1.2e-88 < y < 6.50000000000000001e103

    1. Initial program 90.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*93.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+93.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. Simplified93.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 77.5%

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

    if 6.50000000000000001e103 < y

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 52.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-118} \lor \neg \left(x \leq 2.6 \cdot 10^{-252}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= x -7e-5)
   (/ (/ y x) x)
   (if (or (<= x -2.6e-118) (not (<= x 2.6e-252))) (/ x (* y y)) (/ x y))))
double code(double x, double y) {
	double tmp;
	if (x <= -7e-5) {
		tmp = (y / x) / x;
	} else if ((x <= -2.6e-118) || !(x <= 2.6e-252)) {
		tmp = x / (y * y);
	} else {
		tmp = x / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-7d-5)) then
        tmp = (y / x) / x
    else if ((x <= (-2.6d-118)) .or. (.not. (x <= 2.6d-252))) then
        tmp = x / (y * y)
    else
        tmp = x / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (x <= -7e-5) {
		tmp = (y / x) / x;
	} else if ((x <= -2.6e-118) || !(x <= 2.6e-252)) {
		tmp = x / (y * y);
	} else {
		tmp = x / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if x <= -7e-5:
		tmp = (y / x) / x
	elif (x <= -2.6e-118) or not (x <= 2.6e-252):
		tmp = x / (y * y)
	else:
		tmp = x / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (x <= -7e-5)
		tmp = Float64(Float64(y / x) / x);
	elseif ((x <= -2.6e-118) || !(x <= 2.6e-252))
		tmp = Float64(x / Float64(y * y));
	else
		tmp = Float64(x / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -7e-5)
		tmp = (y / x) / x;
	elseif ((x <= -2.6e-118) || ~((x <= 2.6e-252)))
		tmp = x / (y * y);
	else
		tmp = x / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[x, -7e-5], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[Or[LessEqual[x, -2.6e-118], N[Not[LessEqual[x, 2.6e-252]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.6 \cdot 10^{-118} \lor \neg \left(x \leq 2.6 \cdot 10^{-252}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\

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


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

    1. Initial program 68.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      5. distribute-rgt1-in25.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.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in68.9%

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999994e-5 < x < -2.6e-118 or 2.5999999999999999e-252 < x

    1. Initial program 74.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*84.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+84.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. Simplified84.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 46.8%

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

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

    if -2.6e-118 < x < 2.5999999999999999e-252

    1. Initial program 69.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*78.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+78.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. Simplified78.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 91.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-118} \lor \neg \left(x \leq 2.6 \cdot 10^{-252}\right):\\ \;\;\;\;\frac{x}{y \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 86.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 77.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. +-commutative77.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. +-commutative77.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. +-commutative77.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. *-commutative77.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-in52.0%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define77.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. +-commutative77.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. +-commutative77.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-unmult77.4%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in77.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{x + y} \cdot \frac{\frac{y}{x + y}}{\color{blue}{1 + x}} \]
    12. Step-by-step derivation
      1. +-commutative80.0%

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

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

    if 1.19999999999999996 < y

    1. Initial program 57.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. +-commutative57.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. +-commutative57.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. +-commutative57.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. *-commutative57.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-in54.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-define57.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. +-commutative57.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. +-commutative57.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-unmult57.4%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 62.6% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 77.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. +-commutative77.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. +-commutative77.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. +-commutative77.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. *-commutative77.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-in51.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-define77.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. +-commutative77.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. +-commutative77.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-unmult77.2%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in77.2%

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

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

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

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

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

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

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

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

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

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

    if 2.65000000000000015e-9 < y

    1. Initial program 58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.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-in55.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define58.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. +-commutative58.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. +-commutative58.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-unmult58.6%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in58.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 62.5% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 77.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. +-commutative77.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. +-commutative77.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. +-commutative77.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. *-commutative77.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-in51.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-define77.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. +-commutative77.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. +-commutative77.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-unmult77.2%

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in77.2%

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

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

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

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

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

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

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

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

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

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

    if 4.8e-9 < y

    1. Initial program 58.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*78.2%

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

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

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

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

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

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

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

Alternative 11: 61.9% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 77.2%

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

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

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

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

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

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

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

    if 1.22e-8 < y

    1. Initial program 58.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*78.2%

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

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

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

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

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

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

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

Alternative 12: 61.2% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 77.2%

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

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

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

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

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

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

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

    if 6.69999999999999961e-9 < y

    1. Initial program 58.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*78.2%

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

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

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

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

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

Alternative 13: 61.0% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 68.9%

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      5. distribute-rgt1-in25.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.9%

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

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

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\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)}} \]
      3. distribute-rgt1-in68.9%

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999994e-5 < x

    1. Initial program 72.9%

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

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

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

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

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

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

Alternative 14: 37.2% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 77.4%

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

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

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

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

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

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

    if 1 < y

    1. Initial program 57.4%

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

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

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

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

Alternative 15: 36.6% accurate, 3.4× speedup?

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

\\
\frac{x}{y \cdot y}
\end{array}
Derivation
  1. Initial program 71.9%

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

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

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

Alternative 16: 4.8% accurate, 3.4× speedup?

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

\\
\frac{1}{x + 1}
\end{array}
Derivation
  1. Initial program 71.9%

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

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

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

      \[\leadsto \frac{1}{\color{blue}{x + 1}} \]
  8. Simplified4.8%

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

Alternative 17: 4.2% accurate, 5.7× speedup?

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
    5. distribute-rgt1-in52.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-define71.9%

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

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

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

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

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

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

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

      \[\leadsto \frac{x \cdot y}{\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)}} \]
    3. distribute-rgt1-in71.9%

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

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

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

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

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

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

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

    \[\leadsto 1 \cdot \color{blue}{\frac{1}{y}} \]
  9. Taylor expanded in y around 0 4.0%

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

Alternative 18: 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 71.9%

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

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

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