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

Percentage Accurate: 68.6% → 99.8%
Time: 14.8s
Alternatives: 22
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 22 alternatives:

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

Initial Program: 68.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 84.4% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 61.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. +-commutative61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000000000003e-294 < y < 1.54999999999999992e136

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.54999999999999992e136 < y

    1. Initial program 58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.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-in58.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-define58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x - \color{blue}{x \cdot \frac{1 + 2 \cdot x}{y}}}{y}}{y + x} \]
      4. *-commutative90.6%

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

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

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

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

Alternative 3: 79.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 44.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. +-commutative44.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. +-commutative44.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. +-commutative44.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. *-commutative44.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-in22.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-define44.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. +-commutative44.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. +-commutative44.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-unmult44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.60000000000000017e27 < y < 4.3999999999999999e129

    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-in62.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-define62.7%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      2. cube-mult62.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-frac99.8%

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

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

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

    if 4.3999999999999999e129 < y

    1. Initial program 59.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. +-commutative59.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x - \color{blue}{x \cdot \frac{1 + 2 \cdot x}{y}}}{y}}{y + x} \]
      4. *-commutative90.9%

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

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

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

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

Alternative 4: 82.9% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.30000000000000023e-17 < y < 1.7000000000000001e94

    1. Initial program 90.5%

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

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

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

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

    if 1.7000000000000001e94 < y

    1. Initial program 54.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. +-commutative54.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. +-commutative54.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. +-commutative54.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. *-commutative54.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-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-define54.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.6% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 44.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. +-commutative44.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. +-commutative44.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. +-commutative44.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. *-commutative44.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-in22.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-define44.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. +-commutative44.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. +-commutative44.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-unmult44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e27 < y < 1.05e-32

    1. Initial program 71.7%

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

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

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

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

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

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

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

    if 1.05e-32 < y < 1.20000000000000001e150

    1. Initial program 73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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. *-commutative73.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-in64.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-define73.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. +-commutative73.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. +-commutative73.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-unmult73.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.20000000000000001e150 < 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-in57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.2% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-32 < y < 1.54999999999999992e136

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.54999999999999992e136 < y

    1. Initial program 58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.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-in58.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-define58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x - \color{blue}{x \cdot \frac{1 + 2 \cdot x}{y}}}{y}}{y + x} \]
      4. *-commutative90.6%

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

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

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

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

Alternative 7: 82.4% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.05e-32 < y < 1.26e150

    1. Initial program 73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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. *-commutative73.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-in64.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-define73.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. +-commutative73.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. +-commutative73.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-unmult73.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.26e150 < 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-in57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 65.2% accurate, 0.8× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.74999999999999995e-162 < y < 3.09999999999999987e149

    1. Initial program 73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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. *-commutative73.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-in63.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-define73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.09999999999999987e149 < 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-in57.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 65.0% accurate, 0.8× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.19999999999999991e-161 < y < 1.54999999999999992e136

    1. Initial program 73.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. +-commutative73.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. +-commutative73.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. +-commutative73.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. *-commutative73.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-in62.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-define74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.54999999999999992e136 < y

    1. Initial program 58.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. +-commutative58.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. +-commutative58.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. +-commutative58.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. *-commutative58.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-in58.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-define58.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 60.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 44.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. +-commutative44.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. +-commutative44.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. +-commutative44.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. *-commutative44.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-in22.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-define44.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. +-commutative44.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. +-commutative44.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-unmult44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.7999999999999997e27 < y < 4.8000000000000001e-137

    1. Initial program 71.6%

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

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

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

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

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

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

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

    if 4.8000000000000001e-137 < y

    1. Initial program 67.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. +-commutative67.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 60.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 44.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. +-commutative44.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. +-commutative44.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. +-commutative44.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. *-commutative44.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-in22.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-define44.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. +-commutative44.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. +-commutative44.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-unmult44.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{y + x}}{\frac{y + x}{y} \cdot \frac{x + \left(y + 1\right)}{x}}} \]
    11. Taylor expanded in x around inf 33.4%

      \[\leadsto \frac{\frac{1}{y + x}}{\color{blue}{\frac{x}{y}}} \]

    if -7.7999999999999997e27 < y < 4.90000000000000016e-138

    1. Initial program 71.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*83.3%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+83.3%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified83.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 77.6%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. +-commutative77.6%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified77.6%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 4.90000000000000016e-138 < y

    1. Initial program 67.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*83.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+83.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. Simplified83.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 60.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity60.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative60.3%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac61.7%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr61.7%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/61.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity61.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative61.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr61.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+27}:\\ \;\;\;\;\frac{\frac{1}{y + x}}{\frac{x}{y}}\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{-138}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 60.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+27}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-138}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y -7.8e+27)
   (/ (/ y x) (+ y x))
   (if (<= y 2.35e-138) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y))))
double code(double x, double y) {
	double tmp;
	if (y <= -7.8e+27) {
		tmp = (y / x) / (y + x);
	} else if (y <= 2.35e-138) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= (-7.8d+27)) then
        tmp = (y / x) / (y + x)
    else if (y <= 2.35d-138) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / (y + 1.0d0)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= -7.8e+27) {
		tmp = (y / x) / (y + x);
	} else if (y <= 2.35e-138) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= -7.8e+27:
		tmp = (y / x) / (y + x)
	elif y <= 2.35e-138:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / (y + 1.0)) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= -7.8e+27)
		tmp = Float64(Float64(y / x) / Float64(y + x));
	elseif (y <= 2.35e-138)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(y + 1.0)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= -7.8e+27)
		tmp = (y / x) / (y + x);
	elseif (y <= 2.35e-138)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / (y + 1.0)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, -7.8e+27], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.35e-138], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{+27}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\

\mathbf{elif}\;y \leq 2.35 \cdot 10^{-138}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.7999999999999997e27

    1. Initial program 44.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. +-commutative44.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. +-commutative44.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. +-commutative44.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. *-commutative44.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-in22.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-define44.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. +-commutative44.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. +-commutative44.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-unmult44.4%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      10. +-commutative44.4%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified44.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. *-commutative44.4%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define22.7%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult22.7%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in44.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. *-commutative44.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      6. associate-*l*44.4%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      7. times-frac71.0%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      8. associate-+r+71.0%

        \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    6. Applied egg-rr71.0%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. frac-times44.4%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)}} \]
      2. *-commutative44.4%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      3. *-un-lft-identity44.4%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y\right)}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      4. frac-times49.9%

        \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      5. associate-*l/49.9%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
      6. *-un-lft-identity49.9%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      7. associate-/l*71.0%

        \[\leadsto \frac{\color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      8. +-commutative71.0%

        \[\leadsto \frac{x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(x + \left(y + 1\right)\right)}}{x + y} \]
      9. +-commutative71.0%

        \[\leadsto \frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{y + x}} \]
    8. Applied egg-rr71.0%

      \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{y + x}} \]
    9. Step-by-step derivation
      1. associate-*r/49.9%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}}{y + x} \]
      2. +-commutative49.9%

        \[\leadsto \frac{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \color{blue}{\left(1 + y\right)}\right)}}{y + x} \]
    10. Applied egg-rr49.9%

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \left(1 + y\right)\right)}}}{y + x} \]
    11. Step-by-step derivation
      1. *-commutative49.9%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(x + \left(1 + y\right)\right)}}{y + x} \]
      2. times-frac99.7%

        \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{x + \left(1 + y\right)}}}{y + x} \]
      3. associate-+r+99.7%

        \[\leadsto \frac{\frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(x + 1\right) + y}}}{y + x} \]
    12. Simplified99.7%

      \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(x + 1\right) + y}}}{y + x} \]
    13. Taylor expanded in x around inf 33.2%

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]

    if -7.7999999999999997e27 < y < 2.3500000000000001e-138

    1. Initial program 71.6%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*83.3%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+83.3%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified83.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 77.6%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. +-commutative77.6%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified77.6%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 2.3500000000000001e-138 < y

    1. Initial program 67.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*83.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+83.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. Simplified83.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 60.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity60.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative60.3%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac61.7%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr61.7%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/61.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity61.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative61.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr61.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+27}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-138}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 60.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.8e-137)
   (/ y (* x (+ x 1.0)))
   (if (<= y 5e+133) (/ x (* y (+ y 1.0))) (/ (/ x y) y))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 5e+133) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.8d-137) then
        tmp = y / (x * (x + 1.0d0))
    else if (y <= 5d+133) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = y / (x * (x + 1.0));
	} else if (y <= 5e+133) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.8e-137:
		tmp = y / (x * (x + 1.0))
	elif y <= 5e+133:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.8e-137)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	elseif (y <= 5e+133)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.8e-137)
		tmp = y / (x * (x + 1.0));
	elseif (y <= 5e+133)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.8e-137], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+133], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 4.8000000000000001e-137

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*77.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+77.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. Simplified77.9%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. +-commutative60.5%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 4.8000000000000001e-137 < y < 4.99999999999999961e133

    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*85.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+85.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. Simplified85.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 46.7%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]

    if 4.99999999999999961e133 < y

    1. Initial program 58.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.3%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.3%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 85.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity85.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative85.3%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac89.7%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr89.7%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/89.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity89.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative89.7%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr89.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
    10. Taylor expanded in y around inf 89.7%

      \[\leadsto \frac{\frac{x}{\color{blue}{y}}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 61.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\ \;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.8e-137) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y 1.0)) (+ y x))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else {
		tmp = (x / (y + 1.0)) / (y + x);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.8d-137) then
        tmp = (y / (x + 1.0d0)) / (y + x)
    else
        tmp = (x / (y + 1.0d0)) / (y + x)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = (y / (x + 1.0)) / (y + x);
	} else {
		tmp = (x / (y + 1.0)) / (y + x);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.8e-137:
		tmp = (y / (x + 1.0)) / (y + x)
	else:
		tmp = (x / (y + 1.0)) / (y + x)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.8e-137)
		tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x));
	else
		tmp = Float64(Float64(x / Float64(y + 1.0)) / Float64(y + x));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.8e-137)
		tmp = (y / (x + 1.0)) / (y + x);
	else
		tmp = (x / (y + 1.0)) / (y + x);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.8e-137], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y + x}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.8000000000000001e-137

    1. Initial program 63.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. +-commutative63.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. +-commutative63.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. +-commutative63.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. *-commutative63.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-in50.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right) + \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      6. fma-define63.5%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
      7. +-commutative63.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      8. +-commutative63.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
      9. cube-unmult63.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      10. +-commutative63.5%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified63.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. *-commutative63.5%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define50.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult50.5%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in63.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. *-commutative63.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      6. associate-*l*63.5%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      7. times-frac91.2%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      8. associate-+r+91.2%

        \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    6. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. frac-times63.5%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)}} \]
      2. *-commutative63.5%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      3. *-un-lft-identity63.5%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y\right)}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      4. frac-times67.5%

        \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      5. associate-*l/67.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
      6. *-un-lft-identity67.5%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      7. associate-/l*91.2%

        \[\leadsto \frac{\color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      8. +-commutative91.2%

        \[\leadsto \frac{x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(x + \left(y + 1\right)\right)}}{x + y} \]
      9. +-commutative91.2%

        \[\leadsto \frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{y + x}} \]
    8. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{y + x}} \]
    9. Taylor expanded in y around 0 64.4%

      \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
    10. Step-by-step derivation
      1. +-commutative64.4%

        \[\leadsto \frac{\frac{y}{\color{blue}{x + 1}}}{y + x} \]
    11. Simplified64.4%

      \[\leadsto \frac{\color{blue}{\frac{y}{x + 1}}}{y + x} \]

    if 4.8000000000000001e-137 < y

    1. Initial program 67.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. +-commutative67.8%

        \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. +-commutative67.8%

        \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      3. +-commutative67.8%

        \[\leadsto \frac{x \cdot y}{\left(\left(y + x\right) \cdot \left(y + x\right)\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)} \]
      4. *-commutative67.8%

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}} \]
      5. distribute-rgt1-in62.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-define67.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. +-commutative67.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. +-commutative67.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-unmult67.8%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
      10. +-commutative67.8%

        \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
    3. Simplified67.8%

      \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative67.8%

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
      2. fma-define62.1%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
      3. cube-mult62.2%

        \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      4. distribute-rgt1-in67.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      5. *-commutative67.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      6. associate-*l*67.8%

        \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      7. times-frac94.7%

        \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      8. associate-+r+94.7%

        \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    6. Applied egg-rr94.7%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. frac-times67.8%

        \[\leadsto \color{blue}{\frac{y \cdot x}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)}} \]
      2. *-commutative67.8%

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      3. *-un-lft-identity67.8%

        \[\leadsto \frac{\color{blue}{1 \cdot \left(x \cdot y\right)}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)\right)} \]
      4. frac-times77.4%

        \[\leadsto \color{blue}{\frac{1}{x + y} \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
      5. associate-*l/77.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}{x + y}} \]
      6. *-un-lft-identity77.4%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      7. associate-/l*94.6%

        \[\leadsto \frac{\color{blue}{x \cdot \frac{y}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}}}{x + y} \]
      8. +-commutative94.6%

        \[\leadsto \frac{x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(x + \left(y + 1\right)\right)}}{x + y} \]
      9. +-commutative94.6%

        \[\leadsto \frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{\color{blue}{y + x}} \]
    8. Applied egg-rr94.6%

      \[\leadsto \color{blue}{\frac{x \cdot \frac{y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}{y + x}} \]
    9. Step-by-step derivation
      1. associate-*r/77.4%

        \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \left(y + 1\right)\right)}}}{y + x} \]
      2. +-commutative77.4%

        \[\leadsto \frac{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \color{blue}{\left(1 + y\right)}\right)}}{y + x} \]
    10. Applied egg-rr77.4%

      \[\leadsto \frac{\color{blue}{\frac{x \cdot y}{\left(y + x\right) \cdot \left(x + \left(1 + y\right)\right)}}}{y + x} \]
    11. Step-by-step derivation
      1. *-commutative77.4%

        \[\leadsto \frac{\frac{\color{blue}{y \cdot x}}{\left(y + x\right) \cdot \left(x + \left(1 + y\right)\right)}}{y + x} \]
      2. times-frac99.8%

        \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{x + \left(1 + y\right)}}}{y + x} \]
      3. associate-+r+99.8%

        \[\leadsto \frac{\frac{y}{y + x} \cdot \frac{x}{\color{blue}{\left(x + 1\right) + y}}}{y + x} \]
    12. Simplified99.8%

      \[\leadsto \frac{\color{blue}{\frac{y}{y + x} \cdot \frac{x}{\left(x + 1\right) + y}}}{y + x} \]
    13. Taylor expanded in x around 0 62.4%

      \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
    14. Step-by-step derivation
      1. +-commutative62.4%

        \[\leadsto \frac{\frac{x}{\color{blue}{y + 1}}}{y + x} \]
    15. Simplified62.4%

      \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 60.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 4.8e-137) (/ y (* x (+ x 1.0))) (/ (/ x (+ y 1.0)) y)))
double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 4.8d-137) then
        tmp = y / (x * (x + 1.0d0))
    else
        tmp = (x / (y + 1.0d0)) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 4.8e-137) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / (y + 1.0)) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.8e-137:
		tmp = y / (x * (x + 1.0))
	else:
		tmp = (x / (y + 1.0)) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 4.8e-137)
		tmp = Float64(y / Float64(x * Float64(x + 1.0)));
	else
		tmp = Float64(Float64(x / Float64(y + 1.0)) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 4.8e-137)
		tmp = y / (x * (x + 1.0));
	else
		tmp = (x / (y + 1.0)) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 4.8e-137], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + 1}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.8000000000000001e-137

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*77.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+77.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. Simplified77.9%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. +-commutative60.5%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 4.8000000000000001e-137 < y

    1. Initial program 67.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*83.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+83.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. Simplified83.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 60.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity60.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative60.3%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac61.7%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr61.7%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/61.8%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity61.8%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative61.8%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr61.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 4.8 \cdot 10^{-137}:\\ \;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y + 1}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 60.0% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 4.25 \cdot 10^{-137}:\\ \;\;\;\;\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 4.25e-137) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
	double tmp;
	if (y <= 4.25e-137) {
		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.25d-137) 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.25e-137) {
		tmp = y / (x * (x + 1.0));
	} else {
		tmp = (x / y) / (y + 1.0);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 4.25e-137:
		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.25e-137)
		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 <= 4.25e-137)
		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.25e-137], 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 4.25 \cdot 10^{-137}:\\
\;\;\;\;\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 < 4.2500000000000001e-137

    1. Initial program 63.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*77.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+77.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. Simplified77.9%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    6. Step-by-step derivation
      1. +-commutative60.5%

        \[\leadsto \frac{y}{x \cdot \color{blue}{\left(x + 1\right)}} \]
    7. Simplified60.5%

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(x + 1\right)}} \]

    if 4.2500000000000001e-137 < y

    1. Initial program 67.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*83.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+83.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. Simplified83.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 60.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. associate-/r*61.8%

        \[\leadsto \color{blue}{\frac{\frac{x}{y}}{1 + y}} \]
      2. +-commutative61.8%

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
    7. Simplified61.8%

      \[\leadsto \color{blue}{\frac{\frac{x}{y}}{y + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 49.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y)
 :precision binary64
 (if (<= y 5e+133) (/ x (* y (+ y 1.0))) (/ (/ x y) y)))
double code(double x, double y) {
	double tmp;
	if (y <= 5e+133) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 5d+133) then
        tmp = x / (y * (y + 1.0d0))
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 5e+133) {
		tmp = x / (y * (y + 1.0));
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 5e+133:
		tmp = x / (y * (y + 1.0))
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 5e+133)
		tmp = Float64(x / Float64(y * Float64(y + 1.0)));
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 5e+133)
		tmp = x / (y * (y + 1.0));
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 5e+133], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+133}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 4.99999999999999961e133

    1. Initial program 65.9%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.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+79.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. Simplified79.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 37.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]

    if 4.99999999999999961e133 < y

    1. Initial program 58.5%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. associate-/l*79.3%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+79.3%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified79.3%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 85.3%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity85.3%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative85.3%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac89.7%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr89.7%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/89.7%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity89.7%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative89.7%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr89.7%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
    10. Taylor expanded in y around inf 89.7%

      \[\leadsto \frac{\frac{x}{\color{blue}{y}}}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 5 \cdot 10^{+133}:\\ \;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 37.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ (/ x y) y)))
double code(double x, double y) {
	double tmp;
	if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.0d0) then
        tmp = x / y
    else
        tmp = (x / y) / y
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = (x / y) / y;
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 1.0:
		tmp = x / y
	else:
		tmp = (x / y) / y
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 1.0)
		tmp = Float64(x / y);
	else
		tmp = Float64(Float64(x / y) / y);
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.0)
		tmp = x / y;
	else
		tmp = (x / y) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1

    1. Initial program 65.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*80.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+80.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified80.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 34.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Taylor expanded in y around 0 25.3%

      \[\leadsto \color{blue}{\frac{x}{y}} \]

    if 1 < y

    1. Initial program 64.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.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+78.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified78.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Step-by-step derivation
      1. *-un-lft-identity71.8%

        \[\leadsto \frac{\color{blue}{1 \cdot x}}{y \cdot \left(1 + y\right)} \]
      2. +-commutative71.8%

        \[\leadsto \frac{1 \cdot x}{y \cdot \color{blue}{\left(y + 1\right)}} \]
      3. times-frac74.0%

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    7. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    8. Step-by-step derivation
      1. associate-*l/74.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \frac{x}{y + 1}}{y}} \]
      2. *-un-lft-identity74.0%

        \[\leadsto \frac{\color{blue}{\frac{x}{y + 1}}}{y} \]
      3. +-commutative74.0%

        \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y} \]
    9. Applied egg-rr74.0%

      \[\leadsto \color{blue}{\frac{\frac{x}{1 + y}}{y}} \]
    10. Taylor expanded in y around inf 72.0%

      \[\leadsto \frac{\frac{x}{\color{blue}{y}}}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 36.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
(FPCore (x y) :precision binary64 (if (<= y 1.0) (/ x y) (/ x (* y y))))
double code(double x, double y) {
	double tmp;
	if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (y <= 1.0d0) then
        tmp = x / y
    else
        tmp = x / (y * y)
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double tmp;
	if (y <= 1.0) {
		tmp = x / y;
	} else {
		tmp = x / (y * y);
	}
	return tmp;
}
def code(x, y):
	tmp = 0
	if y <= 1.0:
		tmp = x / y
	else:
		tmp = x / (y * y)
	return tmp
function code(x, y)
	tmp = 0.0
	if (y <= 1.0)
		tmp = Float64(x / y);
	else
		tmp = Float64(x / Float64(y * y));
	end
	return tmp
end
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (y <= 1.0)
		tmp = x / y;
	else
		tmp = x / (y * y);
	end
	tmp_2 = tmp;
end
code[x_, y_] := If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;\frac{x}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1

    1. Initial program 65.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*80.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+80.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified80.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 34.9%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Taylor expanded in y around 0 25.3%

      \[\leadsto \color{blue}{\frac{x}{y}} \]

    if 1 < y

    1. Initial program 64.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.1%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+78.1%

        \[\leadsto x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
    3. Simplified78.1%

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in x around 0 71.8%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
    6. Taylor expanded in y around inf 69.8%

      \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 26.1% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \frac{1}{\frac{y}{x}} \end{array} \]
(FPCore (x y) :precision binary64 (/ 1.0 (/ y x)))
double code(double x, double y) {
	return 1.0 / (y / x);
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0 / (y / x)
end function
public static double code(double x, double y) {
	return 1.0 / (y / x);
}
def code(x, y):
	return 1.0 / (y / x)
function code(x, y)
	return Float64(1.0 / Float64(y / x))
end
function tmp = code(x, y)
	tmp = 1.0 / (y / x);
end
code[x_, y_] := N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\frac{y}{x}}
\end{array}
Derivation
  1. Initial program 65.0%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/l*79.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+79.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. Simplified79.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 43.6%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  6. Taylor expanded in y around 0 25.3%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  7. Step-by-step derivation
    1. clear-num25.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
    2. inv-pow25.8%

      \[\leadsto \color{blue}{{\left(\frac{y}{x}\right)}^{-1}} \]
  8. Applied egg-rr25.8%

    \[\leadsto \color{blue}{{\left(\frac{y}{x}\right)}^{-1}} \]
  9. Step-by-step derivation
    1. unpow-125.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
  10. Simplified25.8%

    \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
  11. Add Preprocessing

Alternative 21: 25.6% accurate, 5.7× speedup?

\[\begin{array}{l} \\ \frac{x}{y} \end{array} \]
(FPCore (x y) :precision binary64 (/ x y))
double code(double x, double y) {
	return x / y;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = x / y
end function
public static double code(double x, double y) {
	return x / y;
}
def code(x, y):
	return x / y
function code(x, y)
	return Float64(x / y)
end
function tmp = code(x, y)
	tmp = x / y;
end
code[x_, y_] := N[(x / y), $MachinePrecision]
\begin{array}{l}

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 65.0%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. associate-/l*79.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+79.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. Simplified79.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 43.6%

    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
  6. Taylor expanded in y around 0 25.3%

    \[\leadsto \color{blue}{\frac{x}{y}} \]
  7. Add Preprocessing

Alternative 22: 3.5% accurate, 17.0× speedup?

\[\begin{array}{l} \\ 1 \end{array} \]
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
	return 1.0;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = 1.0d0
end function
public static double code(double x, double y) {
	return 1.0;
}
def code(x, y):
	return 1.0
function code(x, y)
	return 1.0
end
function tmp = code(x, y)
	tmp = 1.0;
end
code[x_, y_] := 1.0
\begin{array}{l}

\\
1
\end{array}
Derivation
  1. Initial program 65.0%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. +-commutative65.0%

      \[\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. +-commutative65.0%

      \[\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. +-commutative65.0%

      \[\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. *-commutative65.0%

      \[\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-define65.0%

      \[\leadsto \frac{x \cdot y}{\color{blue}{\mathsf{fma}\left(y + x, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)}} \]
    7. +-commutative65.0%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(\color{blue}{x + y}, y + x, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    8. +-commutative65.0%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, \color{blue}{x + y}, \left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)\right)} \]
    9. cube-unmult65.0%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, \color{blue}{{\left(y + x\right)}^{3}}\right)} \]
    10. +-commutative65.0%

      \[\leadsto \frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\color{blue}{\left(x + y\right)}}^{3}\right)} \]
  3. Simplified65.0%

    \[\leadsto \color{blue}{\frac{x \cdot y}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative65.0%

      \[\leadsto \frac{\color{blue}{y \cdot x}}{\mathsf{fma}\left(x + y, x + y, {\left(x + y\right)}^{3}\right)} \]
    2. fma-define54.5%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right) + {\left(x + y\right)}^{3}}} \]
    3. cube-mult54.5%

      \[\leadsto \frac{y \cdot x}{\left(x + y\right) \cdot \left(x + y\right) + \color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    4. distribute-rgt1-in65.0%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
    5. *-commutative65.0%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    6. associate-*l*65.0%

      \[\leadsto \frac{y \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
    7. times-frac92.4%

      \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
    8. associate-+r+92.4%

      \[\leadsto \frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \color{blue}{\left(x + \left(y + 1\right)\right)}} \]
  6. Applied egg-rr92.4%

    \[\leadsto \color{blue}{\frac{y}{x + y} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + \left(y + 1\right)\right)}} \]
  7. Taylor expanded in y around 0 55.6%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{1 + x}} \]
  8. Step-by-step derivation
    1. +-commutative55.6%

      \[\leadsto \frac{y}{x + y} \cdot \frac{1}{\color{blue}{x + 1}} \]
  9. Simplified55.6%

    \[\leadsto \frac{y}{x + y} \cdot \color{blue}{\frac{1}{x + 1}} \]
  10. Taylor expanded in x around 0 3.5%

    \[\leadsto \color{blue}{1} \]
  11. 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 2024146 
(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))))