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

Percentage Accurate: 68.8% → 93.5%
Time: 4.2s
Alternatives: 16
Speedup: 1.5×

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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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 16 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));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    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: 93.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{\left(\left(y + x\right) + 1\right) \cdot \left(y + x\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.2e+94)
   (/ (/ y x) (+ 1.0 x))
   (* x (/ (/ y (+ y x)) (* (+ (+ y x) 1.0) (+ y x))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.2e+94) {
		tmp = (y / x) / (1.0 + x);
	} else {
		tmp = x * ((y / (y + x)) / (((y + x) + 1.0) * (y + x)));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.2d+94)) then
        tmp = (y / x) / (1.0d0 + x)
    else
        tmp = x * ((y / (y + x)) / (((y + x) + 1.0d0) * (y + x)))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.2e+94) {
		tmp = (y / x) / (1.0 + x);
	} else {
		tmp = x * ((y / (y + x)) / (((y + x) + 1.0) * (y + x)));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.2e+94:
		tmp = (y / x) / (1.0 + x)
	else:
		tmp = x * ((y / (y + x)) / (((y + x) + 1.0) * (y + x)))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.2e+94)
		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
	else
		tmp = Float64(x * Float64(Float64(y / Float64(y + x)) / Float64(Float64(Float64(y + x) + 1.0) * Float64(y + x))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.2e+94)
		tmp = (y / x) / (1.0 + x);
	else
		tmp = x * ((y / (y + x)) / (((y + x) + 1.0) * (y + x)));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.2e+94], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\

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


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

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
      3. lower-*.f64N/A

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

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
    5. Applied rewrites87.6%

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

        \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
      8. lift-+.f6491.1

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

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

    if -1.19999999999999991e94 < x

    1. Initial program 72.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
      8. lift-+.f64N/A

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

        \[\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)}} \]
      10. lower-*.f64N/A

        \[\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)}} \]
      11. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      12. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      13. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      14. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      16. lower-+.f64N/A

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

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      18. lower-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      19. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      20. lower-+.f6485.3

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
      2. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
      3. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
      4. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      5. lift-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
      8. pow2N/A

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

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      11. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      12. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      13. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      16. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      17. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      18. lift-+.f64N/A

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

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

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      4. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      6. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \color{blue}{\left(\left(y + x\right) + 1\right)}\right)} \]
      7. lift-+.f64N/A

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      10. lower-/.f64N/A

        \[\leadsto x \cdot \frac{\color{blue}{\frac{y}{y + x}}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      11. lift-+.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{\color{blue}{y + x}}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      12. *-commutativeN/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(y + x\right)}} \]
      13. lower-*.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(y + x\right)}} \]
      14. lift-+.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(y + x\right)} \]
      15. lift-+.f64N/A

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

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

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

Alternative 2: 92.7% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{elif}\;x \leq -6.2 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{y}{y + x}}{\left(y + 1\right) \cdot \left(y + x\right)}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (if (<= x -1.2e+94)
   (/ (/ y x) (+ 1.0 x))
   (if (<= x -6.2e-15)
     (* x (/ y (* (+ y x) (* (+ y x) (+ (+ y x) 1.0)))))
     (* x (/ (/ y (+ y x)) (* (+ y 1.0) (+ y x)))))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -1.2e+94) {
		tmp = (y / x) / (1.0 + x);
	} else if (x <= -6.2e-15) {
		tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0))));
	} else {
		tmp = x * ((y / (y + x)) / ((y + 1.0) * (y + x)));
	}
	return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: tmp
    if (x <= (-1.2d+94)) then
        tmp = (y / x) / (1.0d0 + x)
    else if (x <= (-6.2d-15)) then
        tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0d0))))
    else
        tmp = x * ((y / (y + x)) / ((y + 1.0d0) * (y + x)))
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -1.2e+94) {
		tmp = (y / x) / (1.0 + x);
	} else if (x <= -6.2e-15) {
		tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0))));
	} else {
		tmp = x * ((y / (y + x)) / ((y + 1.0) * (y + x)));
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -1.2e+94:
		tmp = (y / x) / (1.0 + x)
	elif x <= -6.2e-15:
		tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0))))
	else:
		tmp = x * ((y / (y + x)) / ((y + 1.0) * (y + x)))
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -1.2e+94)
		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
	elseif (x <= -6.2e-15)
		tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(Float64(y + x) * Float64(Float64(y + x) + 1.0)))));
	else
		tmp = Float64(x * Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + 1.0) * Float64(y + x))));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -1.2e+94)
		tmp = (y / x) / (1.0 + x);
	elseif (x <= -6.2e-15)
		tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0))));
	else
		tmp = x * ((y / (y + x)) / ((y + 1.0) * (y + x)));
	end
	tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := If[LessEqual[x, -1.2e+94], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6.2e-15], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + 1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\
\;\;\;\;\frac{\frac{y}{x}}{1 + x}\\

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

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


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

    1. Initial program 53.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. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
      3. lower-*.f64N/A

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

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
    5. Applied rewrites87.6%

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

        \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
      2. lift-+.f64N/A

        \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
      3. lift-*.f64N/A

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

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

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
      8. lift-+.f6491.1

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

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

    if -1.19999999999999991e94 < x < -6.1999999999999998e-15

    1. Initial program 81.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
      8. lift-+.f64N/A

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

        \[\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)}} \]
      10. lower-*.f64N/A

        \[\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)}} \]
      11. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      12. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      13. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      14. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      16. lower-+.f64N/A

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

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      18. lower-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      19. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      20. lower-+.f6496.8

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
      2. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
      3. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
      4. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      5. lift-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
      8. pow2N/A

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

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      11. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      12. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      13. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      16. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      17. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      18. lift-+.f64N/A

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

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

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

    if -6.1999999999999998e-15 < x

    1. Initial program 71.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. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      4. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      5. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
      7. lift-+.f64N/A

        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
      8. lift-+.f64N/A

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

        \[\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)}} \]
      10. lower-*.f64N/A

        \[\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)}} \]
      11. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      12. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      13. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
      14. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
      16. lower-+.f64N/A

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

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      18. lower-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
      19. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      20. lower-+.f6483.2

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

      \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
      2. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
      3. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
      4. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      5. lift-pow.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
      6. *-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
      7. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
      8. pow2N/A

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

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

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      11. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      12. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      13. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      14. lower-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
      15. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      16. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
      17. +-commutativeN/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
      18. lift-+.f64N/A

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

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

      \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      2. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      3. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      4. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(y + x\right) + 1\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}} \]
      6. lift-+.f64N/A

        \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \color{blue}{\left(\left(y + x\right) + 1\right)}\right)} \]
      7. lift-+.f64N/A

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

        \[\leadsto x \cdot \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      9. lower-/.f64N/A

        \[\leadsto x \cdot \color{blue}{\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)}} \]
      10. lower-/.f64N/A

        \[\leadsto x \cdot \frac{\color{blue}{\frac{y}{y + x}}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      11. lift-+.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{\color{blue}{y + x}}}{\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)} \]
      12. *-commutativeN/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(y + x\right)}} \]
      13. lower-*.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot \left(y + x\right)}} \]
      14. lift-+.f64N/A

        \[\leadsto x \cdot \frac{\frac{y}{y + x}}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(y + x\right)} \]
      15. lift-+.f64N/A

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

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

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

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

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

    Alternative 3: 89.3% accurate, 0.8× speedup?

    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{elif}\;x \leq -1 \cdot 10^{-162}:\\ \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\ \end{array} \end{array} \]
    NOTE: x and y should be sorted in increasing order before calling this function.
    (FPCore (x y)
     :precision binary64
     (if (<= x -1.2e+94)
       (/ (/ y x) (+ 1.0 x))
       (if (<= x -1e-162)
         (* x (/ y (* (+ y x) (* (+ y x) (+ (+ y x) 1.0)))))
         (/ x (fma y 1.0 (* y y))))))
    assert(x < y);
    double code(double x, double y) {
    	double tmp;
    	if (x <= -1.2e+94) {
    		tmp = (y / x) / (1.0 + x);
    	} else if (x <= -1e-162) {
    		tmp = x * (y / ((y + x) * ((y + x) * ((y + x) + 1.0))));
    	} else {
    		tmp = x / fma(y, 1.0, (y * y));
    	}
    	return tmp;
    }
    
    x, y = sort([x, y])
    function code(x, y)
    	tmp = 0.0
    	if (x <= -1.2e+94)
    		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
    	elseif (x <= -1e-162)
    		tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(Float64(y + x) * Float64(Float64(y + x) + 1.0)))));
    	else
    		tmp = Float64(x / fma(y, 1.0, Float64(y * y)));
    	end
    	return tmp
    end
    
    NOTE: x and y should be sorted in increasing order before calling this function.
    code[x_, y_] := If[LessEqual[x, -1.2e+94], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1e-162], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * 1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y] = \mathsf{sort}([x, y])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -1.2 \cdot 10^{+94}:\\
    \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
    
    \mathbf{elif}\;x \leq -1 \cdot 10^{-162}:\\
    \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\left(y + x\right) + 1\right)\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -1.19999999999999991e94

      1. Initial program 53.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. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
        3. lower-*.f64N/A

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

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
      5. Applied rewrites87.6%

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

          \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
        2. lift-+.f64N/A

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
        3. lift-*.f64N/A

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

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

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
        8. lift-+.f6491.1

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

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

      if -1.19999999999999991e94 < x < -9.99999999999999954e-163

      1. Initial program 87.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        4. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        5. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        6. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
        8. lift-+.f64N/A

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

          \[\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)}} \]
        10. lower-*.f64N/A

          \[\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)}} \]
        11. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        12. *-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
        13. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
        14. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
        15. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
        16. lower-+.f64N/A

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

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
        18. lower-pow.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
        19. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
        20. lower-+.f6498.0

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      4. Applied rewrites98.0%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
        5. lift-pow.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
        6. *-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
        7. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
        8. pow2N/A

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

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

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        11. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        12. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        13. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        14. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        15. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        16. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        17. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
        18. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
        19. lift-+.f6498.0

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

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

      if -9.99999999999999954e-163 < x

      1. Initial program 66.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. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
        3. lower-*.f64N/A

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

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
      5. Applied rewrites53.1%

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

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
        3. *-commutativeN/A

          \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
        4. distribute-lft-inN/A

          \[\leadsto \frac{x}{y \cdot 1 + \color{blue}{y \cdot y}} \]
        5. pow2N/A

          \[\leadsto \frac{x}{y \cdot 1 + {y}^{\color{blue}{2}}} \]
        6. lower-fma.f64N/A

          \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, {y}^{2}\right)} \]
        7. pow2N/A

          \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
        8. lift-*.f6453.1

          \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
      7. Applied rewrites53.1%

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

    Alternative 4: 85.6% accurate, 0.8× speedup?

    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+94}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(x + 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\ \end{array} \end{array} \]
    NOTE: x and y should be sorted in increasing order before calling this function.
    (FPCore (x y)
     :precision binary64
     (if (<= x -1.1e+94)
       (/ (/ y x) (+ 1.0 x))
       (if (<= x -7.5e-159)
         (* x (/ y (* (+ y x) (* (+ y x) (+ x 1.0)))))
         (/ x (fma y 1.0 (* y y))))))
    assert(x < y);
    double code(double x, double y) {
    	double tmp;
    	if (x <= -1.1e+94) {
    		tmp = (y / x) / (1.0 + x);
    	} else if (x <= -7.5e-159) {
    		tmp = x * (y / ((y + x) * ((y + x) * (x + 1.0))));
    	} else {
    		tmp = x / fma(y, 1.0, (y * y));
    	}
    	return tmp;
    }
    
    x, y = sort([x, y])
    function code(x, y)
    	tmp = 0.0
    	if (x <= -1.1e+94)
    		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
    	elseif (x <= -7.5e-159)
    		tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(Float64(y + x) * Float64(x + 1.0)))));
    	else
    		tmp = Float64(x / fma(y, 1.0, Float64(y * y)));
    	end
    	return tmp
    end
    
    NOTE: x and y should be sorted in increasing order before calling this function.
    code[x_, y_] := If[LessEqual[x, -1.1e+94], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.5e-159], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * 1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y] = \mathsf{sort}([x, y])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;x \leq -1.1 \cdot 10^{+94}:\\
    \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
    
    \mathbf{elif}\;x \leq -7.5 \cdot 10^{-159}:\\
    \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(x + 1\right)\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -1.10000000000000006e94

      1. Initial program 53.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. Add Preprocessing
      3. Taylor expanded in y around 0

        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

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

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
        3. lower-*.f64N/A

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

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
      5. Applied rewrites87.6%

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

          \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
        2. lift-+.f64N/A

          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
        3. lift-*.f64N/A

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

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

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
        8. lift-+.f6491.1

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

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

      if -1.10000000000000006e94 < x < -7.5e-159

      1. Initial program 87.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. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        4. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        5. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        6. lift-*.f64N/A

          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
        7. lift-+.f64N/A

          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
        8. lift-+.f64N/A

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

          \[\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)}} \]
        10. lower-*.f64N/A

          \[\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)}} \]
        11. lower-/.f64N/A

          \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
        12. *-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
        13. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
        14. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
        15. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
        16. lower-+.f64N/A

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

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
        18. lower-pow.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
        19. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
        20. lower-+.f6498.0

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
      4. Applied rewrites98.0%

        \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
        2. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
        3. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
        4. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
        5. lift-pow.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
        6. *-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
        7. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
        8. pow2N/A

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

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

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        11. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        12. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        13. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        14. lower-*.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
        15. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        16. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
        17. +-commutativeN/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
        18. lift-+.f64N/A

          \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
        19. lift-+.f6498.0

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

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

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

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

        if -7.5e-159 < x

        1. Initial program 66.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. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          3. lower-*.f64N/A

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
        5. Applied rewrites53.1%

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
          4. distribute-lft-inN/A

            \[\leadsto \frac{x}{y \cdot 1 + \color{blue}{y \cdot y}} \]
          5. pow2N/A

            \[\leadsto \frac{x}{y \cdot 1 + {y}^{\color{blue}{2}}} \]
          6. lower-fma.f64N/A

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, {y}^{2}\right)} \]
          7. pow2N/A

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
          8. lift-*.f6453.1

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
        7. Applied rewrites53.1%

          \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, y \cdot y\right)} \]
      9. Recombined 3 regimes into one program.
      10. Add Preprocessing

      Alternative 5: 80.7% accurate, 0.9× speedup?

      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.1 \cdot 10^{+94}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-86}:\\ \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\ \end{array} \end{array} \]
      NOTE: x and y should be sorted in increasing order before calling this function.
      (FPCore (x y)
       :precision binary64
       (if (<= x -1.1e+94)
         (/ (/ y x) (+ 1.0 x))
         (if (<= x -3.2e-86)
           (* x (/ y (* (+ y x) (* (+ 1.0 x) x))))
           (/ x (fma y 1.0 (* y y))))))
      assert(x < y);
      double code(double x, double y) {
      	double tmp;
      	if (x <= -1.1e+94) {
      		tmp = (y / x) / (1.0 + x);
      	} else if (x <= -3.2e-86) {
      		tmp = x * (y / ((y + x) * ((1.0 + x) * x)));
      	} else {
      		tmp = x / fma(y, 1.0, (y * y));
      	}
      	return tmp;
      }
      
      x, y = sort([x, y])
      function code(x, y)
      	tmp = 0.0
      	if (x <= -1.1e+94)
      		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
      	elseif (x <= -3.2e-86)
      		tmp = Float64(x * Float64(y / Float64(Float64(y + x) * Float64(Float64(1.0 + x) * x))));
      	else
      		tmp = Float64(x / fma(y, 1.0, Float64(y * y)));
      	end
      	return tmp
      end
      
      NOTE: x and y should be sorted in increasing order before calling this function.
      code[x_, y_] := If[LessEqual[x, -1.1e+94], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-86], N[(x * N[(y / N[(N[(y + x), $MachinePrecision] * N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * 1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      [x, y] = \mathsf{sort}([x, y])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -1.1 \cdot 10^{+94}:\\
      \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
      
      \mathbf{elif}\;x \leq -3.2 \cdot 10^{-86}:\\
      \;\;\;\;x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot x\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x < -1.10000000000000006e94

        1. Initial program 53.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. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
          3. lower-*.f64N/A

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

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
        5. Applied rewrites87.6%

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

            \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
          2. lift-+.f64N/A

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
          3. lift-*.f64N/A

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

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

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
          6. lower-/.f64N/A

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
          8. lift-+.f6491.1

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

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

        if -1.10000000000000006e94 < x < -3.20000000000000006e-86

        1. Initial program 87.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. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
          4. lift-+.f64N/A

            \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          5. lift-+.f64N/A

            \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          6. lift-*.f64N/A

            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
          7. lift-+.f64N/A

            \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
          8. lift-+.f64N/A

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

            \[\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)}} \]
          10. lower-*.f64N/A

            \[\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)}} \]
          11. lower-/.f64N/A

            \[\leadsto x \cdot \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
          12. *-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
          13. lower-*.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
          14. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(x + y\right) + 1\right)} \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
          15. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
          16. lower-+.f64N/A

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

            \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
          18. lower-pow.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(x + y\right)}^{2}}} \]
          19. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
          20. lower-+.f6497.8

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

          \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right) \cdot {\left(y + x\right)}^{2}}} \]
          2. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(\left(y + x\right) + 1\right)} \cdot {\left(y + x\right)}^{2}} \]
          3. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} + 1\right) \cdot {\left(y + x\right)}^{2}} \]
          4. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot {\color{blue}{\left(y + x\right)}}^{2}} \]
          5. lift-pow.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(\left(y + x\right) + 1\right) \cdot \color{blue}{{\left(y + x\right)}^{2}}} \]
          6. *-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{{\left(y + x\right)}^{2} \cdot \left(\left(y + x\right) + 1\right)}} \]
          7. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{{\color{blue}{\left(x + y\right)}}^{2} \cdot \left(\left(y + x\right) + 1\right)} \]
          8. pow2N/A

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

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

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
          11. lower-*.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
          12. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
          13. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
          14. lower-*.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \color{blue}{\left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
          15. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
          16. lift-+.f64N/A

            \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} \cdot \left(\left(x + y\right) + 1\right)\right)} \]
          17. +-commutativeN/A

            \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(y + x\right) \cdot \left(\color{blue}{\left(y + x\right)} + 1\right)\right)} \]
          18. lift-+.f64N/A

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

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

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

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

            \[\leadsto x \cdot \frac{y}{\left(y + x\right) \cdot \left(\left(1 + x\right) \cdot \color{blue}{x}\right)} \]
          2. lower-*.f64N/A

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

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

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

        if -3.20000000000000006e-86 < x

        1. Initial program 67.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. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          3. lower-*.f64N/A

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
        5. Applied rewrites53.6%

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

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
          3. *-commutativeN/A

            \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
          4. distribute-lft-inN/A

            \[\leadsto \frac{x}{y \cdot 1 + \color{blue}{y \cdot y}} \]
          5. pow2N/A

            \[\leadsto \frac{x}{y \cdot 1 + {y}^{\color{blue}{2}}} \]
          6. lower-fma.f64N/A

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, {y}^{2}\right)} \]
          7. pow2N/A

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
          8. lift-*.f6453.6

            \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
        7. Applied rewrites53.6%

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

      Alternative 6: 72.0% accurate, 1.1× speedup?

      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-x, y, y\right)}{x}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
      NOTE: x and y should be sorted in increasing order before calling this function.
      (FPCore (x y)
       :precision binary64
       (if (<= x -1.0)
         (/ y (* x x))
         (if (<= x -6e-114)
           (/ (fma (- x) y y) x)
           (if (<= x 2.8e-184) (/ x y) (/ x (* y y))))))
      assert(x < y);
      double code(double x, double y) {
      	double tmp;
      	if (x <= -1.0) {
      		tmp = y / (x * x);
      	} else if (x <= -6e-114) {
      		tmp = fma(-x, y, y) / x;
      	} else if (x <= 2.8e-184) {
      		tmp = x / y;
      	} else {
      		tmp = x / (y * y);
      	}
      	return tmp;
      }
      
      x, y = sort([x, y])
      function code(x, y)
      	tmp = 0.0
      	if (x <= -1.0)
      		tmp = Float64(y / Float64(x * x));
      	elseif (x <= -6e-114)
      		tmp = Float64(fma(Float64(-x), y, y) / x);
      	elseif (x <= 2.8e-184)
      		tmp = Float64(x / y);
      	else
      		tmp = Float64(x / Float64(y * y));
      	end
      	return tmp
      end
      
      NOTE: x and y should be sorted in increasing order before calling this function.
      code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-114], N[(N[((-x) * y + y), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, 2.8e-184], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      [x, y] = \mathsf{sort}([x, y])\\
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -1:\\
      \;\;\;\;\frac{y}{x \cdot x}\\
      
      \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(-x, y, y\right)}{x}\\
      
      \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\
      \;\;\;\;\frac{x}{y}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x}{y \cdot y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if x < -1

        1. Initial program 61.7%

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

          \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
          2. unpow2N/A

            \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
          3. lower-*.f6475.3

            \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
        5. Applied rewrites75.3%

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

        if -1 < x < -6.0000000000000003e-114

        1. Initial program 94.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. Add Preprocessing
        3. Taylor expanded in y around 0

          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

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

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
          3. lower-*.f64N/A

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

            \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
        5. Applied rewrites49.5%

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

          \[\leadsto \frac{y}{x} \]
        7. Step-by-step derivation
          1. Applied rewrites48.6%

            \[\leadsto \frac{y}{x} \]
          2. Taylor expanded in x around 0

            \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{\color{blue}{x}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{x} \]
            2. +-commutativeN/A

              \[\leadsto \frac{-1 \cdot \left(x \cdot y\right) + y}{x} \]
            3. associate-*r*N/A

              \[\leadsto \frac{\left(-1 \cdot x\right) \cdot y + y}{x} \]
            4. mul-1-negN/A

              \[\leadsto \frac{\left(\mathsf{neg}\left(x\right)\right) \cdot y + y}{x} \]
            5. lower-fma.f64N/A

              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(x\right), y, y\right)}{x} \]
            6. lower-neg.f6449.5

              \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{x} \]
          4. Applied rewrites49.5%

            \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{\color{blue}{x}} \]

          if -6.0000000000000003e-114 < x < 2.7999999999999998e-184

          1. Initial program 63.4%

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

            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

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

              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
            3. lower-*.f64N/A

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

              \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
          5. Applied rewrites85.6%

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

            \[\leadsto \frac{x}{y} \]
          7. Step-by-step derivation
            1. Applied rewrites76.4%

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

            if 2.7999999999999998e-184 < x

            1. Initial program 68.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. Add Preprocessing
            3. Taylor expanded in y around inf

              \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
              3. lower-*.f6431.0

                \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
            5. Applied rewrites31.0%

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

          Alternative 7: 72.0% accurate, 1.1× speedup?

          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\mathsf{fma}\left(-1, y, \frac{y}{x}\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
          NOTE: x and y should be sorted in increasing order before calling this function.
          (FPCore (x y)
           :precision binary64
           (if (<= x -1.0)
             (/ y (* x x))
             (if (<= x -6e-114)
               (fma -1.0 y (/ y x))
               (if (<= x 2.8e-184) (/ x y) (/ x (* y y))))))
          assert(x < y);
          double code(double x, double y) {
          	double tmp;
          	if (x <= -1.0) {
          		tmp = y / (x * x);
          	} else if (x <= -6e-114) {
          		tmp = fma(-1.0, y, (y / x));
          	} else if (x <= 2.8e-184) {
          		tmp = x / y;
          	} else {
          		tmp = x / (y * y);
          	}
          	return tmp;
          }
          
          x, y = sort([x, y])
          function code(x, y)
          	tmp = 0.0
          	if (x <= -1.0)
          		tmp = Float64(y / Float64(x * x));
          	elseif (x <= -6e-114)
          		tmp = fma(-1.0, y, Float64(y / x));
          	elseif (x <= 2.8e-184)
          		tmp = Float64(x / y);
          	else
          		tmp = Float64(x / Float64(y * y));
          	end
          	return tmp
          end
          
          NOTE: x and y should be sorted in increasing order before calling this function.
          code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-114], N[(-1.0 * y + N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.8e-184], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          [x, y] = \mathsf{sort}([x, y])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -1:\\
          \;\;\;\;\frac{y}{x \cdot x}\\
          
          \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\
          \;\;\;\;\mathsf{fma}\left(-1, y, \frac{y}{x}\right)\\
          
          \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\
          \;\;\;\;\frac{x}{y}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{y \cdot y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if x < -1

            1. Initial program 61.7%

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

              \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
              2. unpow2N/A

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
              3. lower-*.f6475.3

                \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
            5. Applied rewrites75.3%

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

            if -1 < x < -6.0000000000000003e-114

            1. Initial program 94.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. Add Preprocessing
            3. Taylor expanded in y around 0

              \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
              3. lower-*.f64N/A

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

                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
            5. Applied rewrites49.5%

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

              \[\leadsto \frac{y}{x} \]
            7. Step-by-step derivation
              1. Applied rewrites48.6%

                \[\leadsto \frac{y}{x} \]
              2. Taylor expanded in x around 0

                \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{\color{blue}{x}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{x} \]
                2. +-commutativeN/A

                  \[\leadsto \frac{-1 \cdot \left(x \cdot y\right) + y}{x} \]
                3. associate-*r*N/A

                  \[\leadsto \frac{\left(-1 \cdot x\right) \cdot y + y}{x} \]
                4. mul-1-negN/A

                  \[\leadsto \frac{\left(\mathsf{neg}\left(x\right)\right) \cdot y + y}{x} \]
                5. lower-fma.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(x\right), y, y\right)}{x} \]
                6. lower-neg.f6449.5

                  \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{x} \]
              4. Applied rewrites49.5%

                \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{\color{blue}{x}} \]
              5. Taylor expanded in x around inf

                \[\leadsto -1 \cdot y + \frac{y}{\color{blue}{x}} \]
              6. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(-1, y, \frac{y}{x}\right) \]
                2. lower-/.f6449.5

                  \[\leadsto \mathsf{fma}\left(-1, y, \frac{y}{x}\right) \]
              7. Applied rewrites49.5%

                \[\leadsto \mathsf{fma}\left(-1, y, \frac{y}{x}\right) \]

              if -6.0000000000000003e-114 < x < 2.7999999999999998e-184

              1. Initial program 63.4%

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

                \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
              4. Step-by-step derivation
                1. lower-/.f64N/A

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

                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                3. lower-*.f64N/A

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

                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
              5. Applied rewrites85.6%

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

                \[\leadsto \frac{x}{y} \]
              7. Step-by-step derivation
                1. Applied rewrites76.4%

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

                if 2.7999999999999998e-184 < x

                1. Initial program 68.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. Add Preprocessing
                3. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                  2. unpow2N/A

                    \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                  3. lower-*.f6431.0

                    \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                5. Applied rewrites31.0%

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

              Alternative 8: 71.8% accurate, 1.1× speedup?

              \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
              NOTE: x and y should be sorted in increasing order before calling this function.
              (FPCore (x y)
               :precision binary64
               (if (<= x -1.0)
                 (/ y (* x x))
                 (if (<= x -6e-114) (/ y x) (if (<= x 2.8e-184) (/ x y) (/ x (* y y))))))
              assert(x < y);
              double code(double x, double y) {
              	double tmp;
              	if (x <= -1.0) {
              		tmp = y / (x * x);
              	} else if (x <= -6e-114) {
              		tmp = y / x;
              	} else if (x <= 2.8e-184) {
              		tmp = x / y;
              	} else {
              		tmp = x / (y * y);
              	}
              	return tmp;
              }
              
              NOTE: x and y should be sorted in increasing order before calling this function.
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8) :: tmp
                  if (x <= (-1.0d0)) then
                      tmp = y / (x * x)
                  else if (x <= (-6d-114)) then
                      tmp = y / x
                  else if (x <= 2.8d-184) then
                      tmp = x / y
                  else
                      tmp = x / (y * y)
                  end if
                  code = tmp
              end function
              
              assert x < y;
              public static double code(double x, double y) {
              	double tmp;
              	if (x <= -1.0) {
              		tmp = y / (x * x);
              	} else if (x <= -6e-114) {
              		tmp = y / x;
              	} else if (x <= 2.8e-184) {
              		tmp = x / y;
              	} else {
              		tmp = x / (y * y);
              	}
              	return tmp;
              }
              
              [x, y] = sort([x, y])
              def code(x, y):
              	tmp = 0
              	if x <= -1.0:
              		tmp = y / (x * x)
              	elif x <= -6e-114:
              		tmp = y / x
              	elif x <= 2.8e-184:
              		tmp = x / y
              	else:
              		tmp = x / (y * y)
              	return tmp
              
              x, y = sort([x, y])
              function code(x, y)
              	tmp = 0.0
              	if (x <= -1.0)
              		tmp = Float64(y / Float64(x * x));
              	elseif (x <= -6e-114)
              		tmp = Float64(y / x);
              	elseif (x <= 2.8e-184)
              		tmp = Float64(x / y);
              	else
              		tmp = Float64(x / Float64(y * y));
              	end
              	return tmp
              end
              
              x, y = num2cell(sort([x, y])){:}
              function tmp_2 = code(x, y)
              	tmp = 0.0;
              	if (x <= -1.0)
              		tmp = y / (x * x);
              	elseif (x <= -6e-114)
              		tmp = y / x;
              	elseif (x <= 2.8e-184)
              		tmp = x / y;
              	else
              		tmp = x / (y * y);
              	end
              	tmp_2 = tmp;
              end
              
              NOTE: x and y should be sorted in increasing order before calling this function.
              code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -6e-114], N[(y / x), $MachinePrecision], If[LessEqual[x, 2.8e-184], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              [x, y] = \mathsf{sort}([x, y])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -1:\\
              \;\;\;\;\frac{y}{x \cdot x}\\
              
              \mathbf{elif}\;x \leq -6 \cdot 10^{-114}:\\
              \;\;\;\;\frac{y}{x}\\
              
              \mathbf{elif}\;x \leq 2.8 \cdot 10^{-184}:\\
              \;\;\;\;\frac{x}{y}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{x}{y \cdot y}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if x < -1

                1. Initial program 61.7%

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

                  \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
                  2. unpow2N/A

                    \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                  3. lower-*.f6475.3

                    \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                5. Applied rewrites75.3%

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

                if -1 < x < -6.0000000000000003e-114

                1. Initial program 94.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. Add Preprocessing
                3. Taylor expanded in y around 0

                  \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

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

                    \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                  3. lower-*.f64N/A

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

                    \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                5. Applied rewrites49.5%

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

                  \[\leadsto \frac{y}{x} \]
                7. Step-by-step derivation
                  1. Applied rewrites48.6%

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

                  if -6.0000000000000003e-114 < x < 2.7999999999999998e-184

                  1. Initial program 63.4%

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

                    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

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

                      \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                    3. lower-*.f64N/A

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

                      \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                  5. Applied rewrites85.6%

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

                    \[\leadsto \frac{x}{y} \]
                  7. Step-by-step derivation
                    1. Applied rewrites76.4%

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

                    if 2.7999999999999998e-184 < x

                    1. Initial program 68.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. Add Preprocessing
                    3. Taylor expanded in y around inf

                      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                      2. unpow2N/A

                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                      3. lower-*.f6431.0

                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                    5. Applied rewrites31.0%

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

                  Alternative 9: 77.7% accurate, 1.2× speedup?

                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-x, y, y\right)}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
                  NOTE: x and y should be sorted in increasing order before calling this function.
                  (FPCore (x y)
                   :precision binary64
                   (if (<= x -1.0)
                     (/ y (* x x))
                     (if (<= x -3.2e-86) (/ (fma (- x) y y) x) (/ x (* (+ 1.0 y) y)))))
                  assert(x < y);
                  double code(double x, double y) {
                  	double tmp;
                  	if (x <= -1.0) {
                  		tmp = y / (x * x);
                  	} else if (x <= -3.2e-86) {
                  		tmp = fma(-x, y, y) / x;
                  	} else {
                  		tmp = x / ((1.0 + y) * y);
                  	}
                  	return tmp;
                  }
                  
                  x, y = sort([x, y])
                  function code(x, y)
                  	tmp = 0.0
                  	if (x <= -1.0)
                  		tmp = Float64(y / Float64(x * x));
                  	elseif (x <= -3.2e-86)
                  		tmp = Float64(fma(Float64(-x), y, y) / x);
                  	else
                  		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
                  	end
                  	return tmp
                  end
                  
                  NOTE: x and y should be sorted in increasing order before calling this function.
                  code[x_, y_] := If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-86], N[(N[((-x) * y + y), $MachinePrecision] / x), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  [x, y] = \mathsf{sort}([x, y])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;x \leq -1:\\
                  \;\;\;\;\frac{y}{x \cdot x}\\
                  
                  \mathbf{elif}\;x \leq -3.2 \cdot 10^{-86}:\\
                  \;\;\;\;\frac{\mathsf{fma}\left(-x, y, y\right)}{x}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if x < -1

                    1. Initial program 61.7%

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

                      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
                      2. unpow2N/A

                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                      3. lower-*.f6475.3

                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                    5. Applied rewrites75.3%

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

                    if -1 < x < -3.20000000000000006e-86

                    1. Initial program 96.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. Add Preprocessing
                    3. Taylor expanded in y around 0

                      \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

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

                        \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                      3. lower-*.f64N/A

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

                        \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                    5. Applied rewrites49.4%

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

                      \[\leadsto \frac{y}{x} \]
                    7. Step-by-step derivation
                      1. Applied rewrites48.2%

                        \[\leadsto \frac{y}{x} \]
                      2. Taylor expanded in x around 0

                        \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{\color{blue}{x}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{x} \]
                        2. +-commutativeN/A

                          \[\leadsto \frac{-1 \cdot \left(x \cdot y\right) + y}{x} \]
                        3. associate-*r*N/A

                          \[\leadsto \frac{\left(-1 \cdot x\right) \cdot y + y}{x} \]
                        4. mul-1-negN/A

                          \[\leadsto \frac{\left(\mathsf{neg}\left(x\right)\right) \cdot y + y}{x} \]
                        5. lower-fma.f64N/A

                          \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(x\right), y, y\right)}{x} \]
                        6. lower-neg.f6449.4

                          \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{x} \]
                      4. Applied rewrites49.4%

                        \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{\color{blue}{x}} \]

                      if -3.20000000000000006e-86 < x

                      1. Initial program 67.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. Add Preprocessing
                      3. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                        3. lower-*.f64N/A

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

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                      5. Applied rewrites53.6%

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

                    Alternative 10: 80.6% accurate, 1.2× speedup?

                    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\ \end{array} \end{array} \]
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    (FPCore (x y)
                     :precision binary64
                     (if (<= x -3.2e-86) (/ (/ y x) (+ 1.0 x)) (/ x (fma y 1.0 (* y y)))))
                    assert(x < y);
                    double code(double x, double y) {
                    	double tmp;
                    	if (x <= -3.2e-86) {
                    		tmp = (y / x) / (1.0 + x);
                    	} else {
                    		tmp = x / fma(y, 1.0, (y * y));
                    	}
                    	return tmp;
                    }
                    
                    x, y = sort([x, y])
                    function code(x, y)
                    	tmp = 0.0
                    	if (x <= -3.2e-86)
                    		tmp = Float64(Float64(y / x) / Float64(1.0 + x));
                    	else
                    		tmp = Float64(x / fma(y, 1.0, Float64(y * y)));
                    	end
                    	return tmp
                    end
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    code[x_, y_] := If[LessEqual[x, -3.2e-86], N[(N[(y / x), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * 1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    [x, y] = \mathsf{sort}([x, y])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\
                    \;\;\;\;\frac{\frac{y}{x}}{1 + x}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if x < -3.20000000000000006e-86

                      1. Initial program 72.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. Add Preprocessing
                      3. Taylor expanded in y around 0

                        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

                          \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                        3. lower-*.f64N/A

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

                          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                      5. Applied rewrites67.2%

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

                          \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot x}} \]
                        2. lift-+.f64N/A

                          \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                        3. lift-*.f64N/A

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

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

                          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
                        6. lower-/.f64N/A

                          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1 + x}} \]
                        7. lower-/.f64N/A

                          \[\leadsto \frac{\frac{y}{x}}{\color{blue}{1} + x} \]
                        8. lift-+.f6468.8

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

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

                      if -3.20000000000000006e-86 < x

                      1. Initial program 67.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. Add Preprocessing
                      3. Taylor expanded in x around 0

                        \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                        3. lower-*.f64N/A

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

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                      5. Applied rewrites53.6%

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

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                        3. *-commutativeN/A

                          \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                        4. distribute-lft-inN/A

                          \[\leadsto \frac{x}{y \cdot 1 + \color{blue}{y \cdot y}} \]
                        5. pow2N/A

                          \[\leadsto \frac{x}{y \cdot 1 + {y}^{\color{blue}{2}}} \]
                        6. lower-fma.f64N/A

                          \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, {y}^{2}\right)} \]
                        7. pow2N/A

                          \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
                        8. lift-*.f6453.6

                          \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
                      7. Applied rewrites53.6%

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

                    Alternative 11: 63.9% accurate, 1.3× speedup?

                    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.3 \cdot 10^{-145}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;\frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    (FPCore (x y)
                     :precision binary64
                     (if (<= y 4.3e-145) (/ y x) (if (<= y 1.0) (/ x y) (/ x (* y y)))))
                    assert(x < y);
                    double code(double x, double y) {
                    	double tmp;
                    	if (y <= 4.3e-145) {
                    		tmp = y / x;
                    	} else if (y <= 1.0) {
                    		tmp = x / y;
                    	} else {
                    		tmp = x / (y * y);
                    	}
                    	return tmp;
                    }
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8) :: tmp
                        if (y <= 4.3d-145) then
                            tmp = y / x
                        else if (y <= 1.0d0) then
                            tmp = x / y
                        else
                            tmp = x / (y * y)
                        end if
                        code = tmp
                    end function
                    
                    assert x < y;
                    public static double code(double x, double y) {
                    	double tmp;
                    	if (y <= 4.3e-145) {
                    		tmp = y / x;
                    	} else if (y <= 1.0) {
                    		tmp = x / y;
                    	} else {
                    		tmp = x / (y * y);
                    	}
                    	return tmp;
                    }
                    
                    [x, y] = sort([x, y])
                    def code(x, y):
                    	tmp = 0
                    	if y <= 4.3e-145:
                    		tmp = y / x
                    	elif y <= 1.0:
                    		tmp = x / y
                    	else:
                    		tmp = x / (y * y)
                    	return tmp
                    
                    x, y = sort([x, y])
                    function code(x, y)
                    	tmp = 0.0
                    	if (y <= 4.3e-145)
                    		tmp = Float64(y / x);
                    	elseif (y <= 1.0)
                    		tmp = Float64(x / y);
                    	else
                    		tmp = Float64(x / Float64(y * y));
                    	end
                    	return tmp
                    end
                    
                    x, y = num2cell(sort([x, y])){:}
                    function tmp_2 = code(x, y)
                    	tmp = 0.0;
                    	if (y <= 4.3e-145)
                    		tmp = y / x;
                    	elseif (y <= 1.0)
                    		tmp = x / y;
                    	else
                    		tmp = x / (y * y);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    code[x_, y_] := If[LessEqual[y, 4.3e-145], N[(y / x), $MachinePrecision], If[LessEqual[y, 1.0], N[(x / y), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    [x, y] = \mathsf{sort}([x, y])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y \leq 4.3 \cdot 10^{-145}:\\
                    \;\;\;\;\frac{y}{x}\\
                    
                    \mathbf{elif}\;y \leq 1:\\
                    \;\;\;\;\frac{x}{y}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{x}{y \cdot y}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y < 4.2999999999999999e-145

                      1. Initial program 66.7%

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

                        \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

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

                          \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                        3. lower-*.f64N/A

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

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

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

                        \[\leadsto \frac{y}{x} \]
                      7. Step-by-step derivation
                        1. Applied rewrites40.9%

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

                        if 4.2999999999999999e-145 < y < 1

                        1. Initial program 89.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. Add Preprocessing
                        3. Taylor expanded in x around 0

                          \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

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

                            \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                          3. lower-*.f64N/A

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

                            \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                        5. Applied rewrites37.9%

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

                          \[\leadsto \frac{x}{y} \]
                        7. Step-by-step derivation
                          1. Applied rewrites37.6%

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

                          if 1 < y

                          1. Initial program 68.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. Add Preprocessing
                          3. Taylor expanded in y around inf

                            \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                            2. unpow2N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                            3. lower-*.f6472.4

                              \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                          5. Applied rewrites72.4%

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

                        Alternative 12: 78.4% accurate, 1.3× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\ \end{array} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y)
                         :precision binary64
                         (if (<= x -3.2e-86) (/ y (* (+ 1.0 x) x)) (/ x (fma y 1.0 (* y y)))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -3.2e-86) {
                        		tmp = y / ((1.0 + x) * x);
                        	} else {
                        		tmp = x / fma(y, 1.0, (y * y));
                        	}
                        	return tmp;
                        }
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -3.2e-86)
                        		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
                        	else
                        		tmp = Float64(x / fma(y, 1.0, Float64(y * y)));
                        	end
                        	return tmp
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -3.2e-86], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * 1.0 + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\
                        \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -3.20000000000000006e-86

                          1. Initial program 72.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. Add Preprocessing
                          3. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                            3. lower-*.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                          5. Applied rewrites67.2%

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

                          if -3.20000000000000006e-86 < x

                          1. Initial program 67.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. Add Preprocessing
                          3. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                            3. lower-*.f64N/A

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

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                          5. Applied rewrites53.6%

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

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            4. distribute-lft-inN/A

                              \[\leadsto \frac{x}{y \cdot 1 + \color{blue}{y \cdot y}} \]
                            5. pow2N/A

                              \[\leadsto \frac{x}{y \cdot 1 + {y}^{\color{blue}{2}}} \]
                            6. lower-fma.f64N/A

                              \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{1}, {y}^{2}\right)} \]
                            7. pow2N/A

                              \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
                            8. lift-*.f6453.6

                              \[\leadsto \frac{x}{\mathsf{fma}\left(y, 1, y \cdot y\right)} \]
                          7. Applied rewrites53.6%

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

                        Alternative 13: 78.4% accurate, 1.5× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y)
                         :precision binary64
                         (if (<= x -3.2e-86) (/ y (* (+ 1.0 x) x)) (/ x (* (+ 1.0 y) y))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -3.2e-86) {
                        		tmp = y / ((1.0 + x) * x);
                        	} else {
                        		tmp = x / ((1.0 + y) * y);
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8) :: tmp
                            if (x <= (-3.2d-86)) then
                                tmp = y / ((1.0d0 + x) * x)
                            else
                                tmp = x / ((1.0d0 + y) * y)
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -3.2e-86) {
                        		tmp = y / ((1.0 + x) * x);
                        	} else {
                        		tmp = x / ((1.0 + y) * y);
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -3.2e-86:
                        		tmp = y / ((1.0 + x) * x)
                        	else:
                        		tmp = x / ((1.0 + y) * y)
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -3.2e-86)
                        		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
                        	else
                        		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -3.2e-86)
                        		tmp = y / ((1.0 + x) * x);
                        	else
                        		tmp = x / ((1.0 + y) * y);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -3.2e-86], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -3.2 \cdot 10^{-86}:\\
                        \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -3.20000000000000006e-86

                          1. Initial program 72.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. Add Preprocessing
                          3. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                            3. lower-*.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                          5. Applied rewrites67.2%

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

                          if -3.20000000000000006e-86 < x

                          1. Initial program 67.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. Add Preprocessing
                          3. Taylor expanded in x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                            3. lower-*.f64N/A

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

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                          5. Applied rewrites53.6%

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

                        Alternative 14: 43.5% accurate, 2.2× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{-114}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y}\\ \end{array} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y) :precision binary64 (if (<= x -6e-114) (/ y x) (/ x y)))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -6e-114) {
                        		tmp = y / x;
                        	} else {
                        		tmp = x / y;
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8) :: tmp
                            if (x <= (-6d-114)) then
                                tmp = y / x
                            else
                                tmp = x / y
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -6e-114) {
                        		tmp = y / x;
                        	} else {
                        		tmp = x / y;
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -6e-114:
                        		tmp = y / x
                        	else:
                        		tmp = x / y
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -6e-114)
                        		tmp = Float64(y / x);
                        	else
                        		tmp = Float64(x / y);
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -6e-114)
                        		tmp = y / x;
                        	else
                        		tmp = x / y;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -6e-114], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -6 \cdot 10^{-114}:\\
                        \;\;\;\;\frac{y}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{y}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -6.0000000000000003e-114

                          1. Initial program 72.7%

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

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          4. Step-by-step derivation
                            1. lower-/.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                            3. lower-*.f64N/A

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

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                          5. Applied rewrites66.6%

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

                            \[\leadsto \frac{y}{x} \]
                          7. Step-by-step derivation
                            1. Applied rewrites36.6%

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

                            if -6.0000000000000003e-114 < x

                            1. Initial program 66.9%

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

                              \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

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

                                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                              3. lower-*.f64N/A

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

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

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

                              \[\leadsto \frac{x}{y} \]
                            7. Step-by-step derivation
                              1. Applied rewrites34.8%

                                \[\leadsto \frac{x}{y} \]
                            8. Recombined 2 regimes into one program.
                            9. Add Preprocessing

                            Alternative 15: 26.0% accurate, 3.3× speedup?

                            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{x}{y} \end{array} \]
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            (FPCore (x y) :precision binary64 (/ x y))
                            assert(x < y);
                            double code(double x, double y) {
                            	return x / y;
                            }
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                code = x / y
                            end function
                            
                            assert x < y;
                            public static double code(double x, double y) {
                            	return x / y;
                            }
                            
                            [x, y] = sort([x, y])
                            def code(x, y):
                            	return x / y
                            
                            x, y = sort([x, y])
                            function code(x, y)
                            	return Float64(x / y)
                            end
                            
                            x, y = num2cell(sort([x, y])){:}
                            function tmp = code(x, y)
                            	tmp = x / y;
                            end
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            code[x_, y_] := N[(x / y), $MachinePrecision]
                            
                            \begin{array}{l}
                            [x, y] = \mathsf{sort}([x, y])\\
                            \\
                            \frac{x}{y}
                            \end{array}
                            
                            Derivation
                            1. Initial program 69.3%

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

                              \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

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

                                \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                              3. lower-*.f64N/A

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

                                \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                            5. Applied rewrites45.4%

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

                              \[\leadsto \frac{x}{y} \]
                            7. Step-by-step derivation
                              1. Applied rewrites22.4%

                                \[\leadsto \frac{x}{y} \]
                              2. Add Preprocessing

                              Alternative 16: 3.8% accurate, 13.0× speedup?

                              \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ -y \end{array} \]
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              (FPCore (x y) :precision binary64 (- y))
                              assert(x < y);
                              double code(double x, double y) {
                              	return -y;
                              }
                              
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  code = -y
                              end function
                              
                              assert x < y;
                              public static double code(double x, double y) {
                              	return -y;
                              }
                              
                              [x, y] = sort([x, y])
                              def code(x, y):
                              	return -y
                              
                              x, y = sort([x, y])
                              function code(x, y)
                              	return Float64(-y)
                              end
                              
                              x, y = num2cell(sort([x, y])){:}
                              function tmp = code(x, y)
                              	tmp = -y;
                              end
                              
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              code[x_, y_] := (-y)
                              
                              \begin{array}{l}
                              [x, y] = \mathsf{sort}([x, y])\\
                              \\
                              -y
                              \end{array}
                              
                              Derivation
                              1. Initial program 69.3%

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

                                \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                              4. Step-by-step derivation
                                1. lower-/.f64N/A

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

                                  \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                                3. lower-*.f64N/A

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

                                  \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                              5. Applied rewrites52.1%

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

                                \[\leadsto \frac{y}{x} \]
                              7. Step-by-step derivation
                                1. Applied rewrites30.0%

                                  \[\leadsto \frac{y}{x} \]
                                2. Taylor expanded in x around 0

                                  \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{\color{blue}{x}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{y + -1 \cdot \left(x \cdot y\right)}{x} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \frac{-1 \cdot \left(x \cdot y\right) + y}{x} \]
                                  3. associate-*r*N/A

                                    \[\leadsto \frac{\left(-1 \cdot x\right) \cdot y + y}{x} \]
                                  4. mul-1-negN/A

                                    \[\leadsto \frac{\left(\mathsf{neg}\left(x\right)\right) \cdot y + y}{x} \]
                                  5. lower-fma.f64N/A

                                    \[\leadsto \frac{\mathsf{fma}\left(\mathsf{neg}\left(x\right), y, y\right)}{x} \]
                                  6. lower-neg.f6416.0

                                    \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{x} \]
                                4. Applied rewrites16.0%

                                  \[\leadsto \frac{\mathsf{fma}\left(-x, y, y\right)}{\color{blue}{x}} \]
                                5. Taylor expanded in x around inf

                                  \[\leadsto -1 \cdot y \]
                                6. Step-by-step derivation
                                  1. mul-1-negN/A

                                    \[\leadsto \mathsf{neg}\left(y\right) \]
                                  2. lower-neg.f643.8

                                    \[\leadsto -y \]
                                7. Applied rewrites3.8%

                                  \[\leadsto -y \]
                                8. Add Preprocessing

                                Developer Target 1: 99.8% accurate, 0.6× 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)));
                                }
                                
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y)
                                use fmin_fmax_functions
                                    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 2025051 
                                (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))))