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

Percentage Accurate: 68.8% → 99.8%
Time: 14.2s
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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;y \leq 4.3 \cdot 10^{-7}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{t\_0}{x + 1}\\ \mathbf{elif}\;y \leq 8.3 \cdot 10^{+123}:\\ \;\;\;\;x \cdot \frac{y}{\left(x + \left(y + 1\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;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 4.3e-7)
     (* (/ y (+ y x)) (/ t_0 (+ x 1.0)))
     (if (<= y 8.3e+123)
       (* x (/ y (* (+ x (+ y 1.0)) (* (+ y x) (+ y x)))))
       (* t_0 (/ 1.0 (+ y (+ x 1.0))))))))
double code(double x, double y) {
	double t_0 = x / (y + x);
	double tmp;
	if (y <= 4.3e-7) {
		tmp = (y / (y + x)) * (t_0 / (x + 1.0));
	} else if (y <= 8.3e+123) {
		tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
	} 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 <= 4.3d-7) then
        tmp = (y / (y + x)) * (t_0 / (x + 1.0d0))
    else if (y <= 8.3d+123) then
        tmp = x * (y / ((x + (y + 1.0d0)) * ((y + x) * (y + x))))
    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 <= 4.3e-7) {
		tmp = (y / (y + x)) * (t_0 / (x + 1.0));
	} else if (y <= 8.3e+123) {
		tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
	} 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 <= 4.3e-7:
		tmp = (y / (y + x)) * (t_0 / (x + 1.0))
	elif y <= 8.3e+123:
		tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))))
	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 <= 4.3e-7)
		tmp = Float64(Float64(y / Float64(y + x)) * Float64(t_0 / Float64(x + 1.0)));
	elseif (y <= 8.3e+123)
		tmp = Float64(x * Float64(y / Float64(Float64(x + Float64(y + 1.0)) * Float64(Float64(y + x) * Float64(y + x)))));
	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 <= 4.3e-7)
		tmp = (y / (y + x)) * (t_0 / (x + 1.0));
	elseif (y <= 8.3e+123)
		tmp = x * (y / ((x + (y + 1.0)) * ((y + x) * (y + x))));
	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, 4.3e-7], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.3e+123], N[(x * N[(y / N[(N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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 4.3 \cdot 10^{-7}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{t\_0}{x + 1}\\

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

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


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

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.3000000000000001e-7 < y < 8.2999999999999998e123

    1. Initial program 71.6%

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

    if 8.2999999999999998e123 < y

    1. Initial program 61.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 94.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.02 \cdot 10^{+142}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\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}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.0199999999999999e142

    1. Initial program 66.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. +-commutative66.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0199999999999999e142 < y

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.02 \cdot 10^{+142}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y + x\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 4: 80.9% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.10000000000000001 < y

    1. Initial program 65.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. +-commutative65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 81.4% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.79999999999999982 < y

    1. Initial program 65.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. +-commutative65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 58.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 73.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*82.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+82.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. Simplified82.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 65.3%

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

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

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

    if -9.0000000000000001e-141 < x < 5.59999999999999961e-59

    1. Initial program 69.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*86.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+86.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. Simplified86.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 83.5%

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

    if 5.59999999999999961e-59 < x

    1. Initial program 53.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*72.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+72.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. Simplified72.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      4. inv-pow33.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      2. associate-/r/33.7%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{x}} \cdot \frac{1}{y}} \]
      3. clear-num33.9%

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

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

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

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

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

Alternative 7: 60.1% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 73.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*82.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. +-commutative82.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{{\left(y + x\right)}^{2}}}{\frac{\color{blue}{\left(x + 1\right)} + y}{y}} \]
    8. Simplified91.4%

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

      \[\leadsto \frac{\color{blue}{\frac{1}{x}}}{\frac{\left(x + 1\right) + y}{y}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity68.7%

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000001e-141 < x

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

Alternative 8: 59.9% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 73.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. +-commutative73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000001e-141 < x

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

Alternative 9: 59.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 73.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*82.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+82.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. Simplified82.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 65.3%

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

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

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

    if -9.0000000000000001e-141 < x

    1. Initial program 62.1%

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

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

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

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

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

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

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

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

Alternative 10: 48.9% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 67.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*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 x around 0 41.6%

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

    if 1.99999999999999995e38 < y

    1. Initial program 63.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*77.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+77.1%

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

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

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

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

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
      3. clear-num74.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      4. inv-pow74.6%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      2. associate-/r/74.6%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{x}} \cdot \frac{1}{y}} \]
      3. clear-num74.9%

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

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

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

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

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

Alternative 11: 37.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 66.8%

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

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

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

    if 1 < y

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

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

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

        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y + 1}} \]
      3. clear-num70.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      4. inv-pow70.6%

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{\frac{x}{y}}}} \]
      2. associate-/r/70.7%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{y + 1}{x}} \cdot \frac{1}{y}} \]
      3. clear-num70.8%

        \[\leadsto \color{blue}{\frac{x}{y + 1}} \cdot \frac{1}{y} \]
      4. +-commutative70.8%

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

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

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

Alternative 12: 36.7% accurate, 1.7× speedup?

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

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

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


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

    1. Initial program 66.8%

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

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

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

    if 1 < y

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

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

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

Alternative 13: 26.0% accurate, 3.4× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{y}{x}}} \]
  10. Simplified26.6%

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

Alternative 14: 25.7% 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 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.1%

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

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

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

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

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

Alternative 15: 3.5% accurate, 17.0× speedup?

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

\\
1
\end{array}
Derivation
  1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 99.8% accurate, 0.9× speedup?

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))

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