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

Percentage Accurate: 68.5% → 99.8%
Time: 12.7s
Alternatives: 15
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 15 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

\\
\frac{y}{y + \left(x + 1\right)} \cdot \frac{\frac{x}{y + x}}{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*83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.0% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 64.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.79999999999999991e-16 < y < 4.19999999999999966e119

    1. Initial program 74.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*90.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+90.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. Simplified90.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

    if 4.19999999999999966e119 < y

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.6% accurate, 0.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \frac{1}{t\_0}\\


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

    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. associate-/l*83.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+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. Step-by-step derivation
      1. associate-*r/64.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.05e-11 < y < 1.89999999999999997e123

    1. Initial program 73.8%

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

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

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

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

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

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
      3. associate-*l*73.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)}} \]
      4. associate-/r*80.1%

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

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

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

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

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

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

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

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

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

    if 1.89999999999999997e123 < y

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.1% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

    if 3.50000000000000005e-239 < y < 1.89999999999999997e123

    1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.89999999999999997e123 < y

    1. Initial program 61.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 93.0% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 47.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000001e73 < x

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      2. associate-+l+85.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. Step-by-step derivation
      1. *-un-lft-identity85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 62.3% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

    if 3.50000000000000005e-239 < y < 3.5000000000000003e151

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5000000000000003e151 < y

    1. Initial program 67.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr97.8%

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

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

Alternative 7: 61.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq -5.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{y}{x} - y\\

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


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

    1. Initial program 51.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*75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -5.4999999999999999e-29

    1. Initial program 79.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*89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    13. Simplified55.0%

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

    if -5.4999999999999999e-29 < x

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

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

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

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

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

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

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

Alternative 8: 45.1% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;x \leq -6 \cdot 10^{-158}:\\
\;\;\;\;\frac{y}{x} - y\\

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


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

    1. Initial program 51.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*75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1 < x < -6e-158

    1. Initial program 83.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y}{x} - y} \]
    13. Simplified39.4%

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

    if -6e-158 < x

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

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

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

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

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

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

Alternative 9: 60.9% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

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

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

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

    if 3.49999999999999998e-94 < y

    1. Initial program 67.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr80.8%

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

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

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

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

Alternative 10: 60.1% accurate, 1.4× speedup?

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

    1. Initial program 63.7%

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

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

    if 2.1000000000000001e-94 < y

    1. Initial program 67.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{y} \cdot \frac{x}{y + 1}} \]
    9. Applied egg-rr80.8%

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

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

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

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

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

Alternative 11: 59.3% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 63.7%

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

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

    if 3.49999999999999998e-94 < y

    1. Initial program 67.2%

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

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

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

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

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

Alternative 12: 22.5% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 63.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.50000000000000005e-239 < y

    1. Initial program 66.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*83.8%

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

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

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

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

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

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

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

Alternative 13: 26.2% accurate, 5.7× speedup?

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

\\
\frac{x}{y}
\end{array}
Derivation
  1. Initial program 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*83.6%

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

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

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

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

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

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

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

Alternative 14: 4.2% accurate, 5.7× speedup?

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

\\
\frac{1}{y}
\end{array}
Derivation
  1. Initial program 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*83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 3.6% accurate, 8.5× speedup?

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

\\
-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*83.6%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot y} \]
  12. Step-by-step derivation
    1. neg-mul-13.7%

      \[\leadsto \color{blue}{-y} \]
  13. Simplified3.7%

    \[\leadsto \color{blue}{-y} \]
  14. Add Preprocessing

Developer target: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

?
herbie shell --seed 2024091 
(FPCore (x y)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
  :precision binary64

  :alt
  (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))

  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))