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

Percentage Accurate: 69.1% → 99.8%
Time: 14.4s
Alternatives: 17
Speedup: 0.1×

Specification

?
\[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
(FPCore (x y)
  :precision binary64
  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1))))
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), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}

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 17 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: 69.1% accurate, 1.0× speedup?

\[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
(FPCore (x y)
  :precision binary64
  (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1))))
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), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}

Alternative 1: 99.8% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \frac{\frac{\mathsf{max}\left(x, y\right)}{t\_0 - -1} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}}{t\_0} \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))))
  (/ (* (/ (fmax x y) (- t_0 -1)) (/ (fmin x y) t_0)) t_0)))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	return ((fmax(x, y) / (t_0 - -1.0)) * (fmin(x, y) / t_0)) / t_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
    real(8) :: t_0
    t_0 = fmax(x, y) + fmin(x, y)
    code = ((fmax(x, y) / (t_0 - (-1.0d0))) * (fmin(x, y) / t_0)) / t_0
end function
public static double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	return ((fmax(x, y) / (t_0 - -1.0)) * (fmin(x, y) / t_0)) / t_0;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	return ((fmax(x, y) / (t_0 - -1.0)) * (fmin(x, y) / t_0)) / t_0
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	return Float64(Float64(Float64(fmax(x, y) / Float64(t_0 - -1.0)) * Float64(fmin(x, y) / t_0)) / t_0)
end
function tmp = code(x, y)
	t_0 = max(x, y) + min(x, y);
	tmp = ((max(x, y) / (t_0 - -1.0)) * (min(x, y) / t_0)) / t_0;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[Max[x, y], $MachinePrecision] / N[(t$95$0 - -1), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\frac{\frac{\mathsf{max}\left(x, y\right)}{t\_0 - -1} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}}{t\_0}
\end{array}
Derivation
  1. Initial program 69.1%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. Step-by-step derivation
    1. 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)}} \]
    2. 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)} \]
    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. times-fracN/A

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

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

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

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

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

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

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

Alternative 2: 96.7% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ t_1 := \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)} \cdot t\_1}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 190000000000000002554336558658854307251328941103111221517760272427978167158121388581265962915685917305365907734694073873647470314742497455613285250308767744:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)} \cdot t\_1}{t\_0}\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))) (t_1 (/ (fmin x y) t_0)))
  (if (<=
       (fmax x y)
       -3299999999999999711783531468410197741562225802346496)
    (/ (* (/ (fmax x y) (fmin x y)) t_1) t_0)
    (if (<=
         (fmax x y)
         190000000000000002554336558658854307251328941103111221517760272427978167158121388581265962915685917305365907734694073873647470314742497455613285250308767744)
      (* (/ (fmax x y) t_0) (/ (fmin x y) (* (- t_0 -1) t_0)))
      (/ (* (/ (fmax x y) (+ 1 (fmax x y))) t_1) t_0)))))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double t_1 = fmin(x, y) / t_0;
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = ((fmax(x, y) / fmin(x, y)) * t_1) / t_0;
	} else if (fmax(x, y) <= 1.9e+155) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = ((fmax(x, y) / (1.0 + fmax(x, y))) * t_1) / t_0;
	}
	return tmp;
}
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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = fmax(x, y) + fmin(x, y)
    t_1 = fmin(x, y) / t_0
    if (fmax(x, y) <= (-3.3d+51)) then
        tmp = ((fmax(x, y) / fmin(x, y)) * t_1) / t_0
    else if (fmax(x, y) <= 1.9d+155) then
        tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - (-1.0d0)) * t_0))
    else
        tmp = ((fmax(x, y) / (1.0d0 + fmax(x, y))) * t_1) / t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double t_1 = fmin(x, y) / t_0;
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = ((fmax(x, y) / fmin(x, y)) * t_1) / t_0;
	} else if (fmax(x, y) <= 1.9e+155) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = ((fmax(x, y) / (1.0 + fmax(x, y))) * t_1) / t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	t_1 = fmin(x, y) / t_0
	tmp = 0
	if fmax(x, y) <= -3.3e+51:
		tmp = ((fmax(x, y) / fmin(x, y)) * t_1) / t_0
	elif fmax(x, y) <= 1.9e+155:
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0))
	else:
		tmp = ((fmax(x, y) / (1.0 + fmax(x, y))) * t_1) / t_0
	return tmp
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	t_1 = Float64(fmin(x, y) / t_0)
	tmp = 0.0
	if (fmax(x, y) <= -3.3e+51)
		tmp = Float64(Float64(Float64(fmax(x, y) / fmin(x, y)) * t_1) / t_0);
	elseif (fmax(x, y) <= 1.9e+155)
		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * t_0)));
	else
		tmp = Float64(Float64(Float64(fmax(x, y) / Float64(1.0 + fmax(x, y))) * t_1) / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = max(x, y) + min(x, y);
	t_1 = min(x, y) / t_0;
	tmp = 0.0;
	if (max(x, y) <= -3.3e+51)
		tmp = ((max(x, y) / min(x, y)) * t_1) / t_0;
	elseif (max(x, y) <= 1.9e+155)
		tmp = (max(x, y) / t_0) * (min(x, y) / ((t_0 - -1.0) * t_0));
	else
		tmp = ((max(x, y) / (1.0 + max(x, y))) * t_1) / t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -3299999999999999711783531468410197741562225802346496], N[(N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 190000000000000002554336558658854307251328941103111221517760272427978167158121388581265962915685917305365907734694073873647470314742497455613285250308767744], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
t_1 := \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)} \cdot t\_1}{t\_0}\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 190000000000000002554336558658854307251328941103111221517760272427978167158121388581265962915685917305365907734694073873647470314742497455613285250308767744:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\

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


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

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{y}{x}} \cdot \frac{x}{y + x}}{y + x} \]
    5. Step-by-step derivation
      1. lower-/.f6438.9%

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

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

    if -3.2999999999999997e51 < y < 1.9e155

    1. Initial program 69.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\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{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
      22. metadata-eval93.1%

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

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

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

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

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

    if 1.9e155 < y

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{y}{1 + \color{blue}{y}} \cdot \frac{x}{y + x}}{y + x} \]
    6. Applied rewrites75.2%

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

Alternative 3: 96.7% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))))
  (if (<=
       (fmax x y)
       -3299999999999999711783531468410197741562225802346496)
    (/ (* (/ (fmax x y) (fmin x y)) (/ (fmin x y) t_0)) t_0)
    (if (<=
         (fmax x y)
         4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232)
      (* (/ (fmax x y) t_0) (/ (fmin x y) (* (- t_0 -1) t_0)))
      (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0)))))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = ((fmax(x, y) / fmin(x, y)) * (fmin(x, y) / t_0)) / t_0;
	} else if (fmax(x, y) <= 4.3e+156) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
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) :: t_0
    real(8) :: tmp
    t_0 = fmax(x, y) + fmin(x, y)
    if (fmax(x, y) <= (-3.3d+51)) then
        tmp = ((fmax(x, y) / fmin(x, y)) * (fmin(x, y) / t_0)) / t_0
    else if (fmax(x, y) <= 4.3d+156) then
        tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - (-1.0d0)) * t_0))
    else
        tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = ((fmax(x, y) / fmin(x, y)) * (fmin(x, y) / t_0)) / t_0;
	} else if (fmax(x, y) <= 4.3e+156) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	tmp = 0
	if fmax(x, y) <= -3.3e+51:
		tmp = ((fmax(x, y) / fmin(x, y)) * (fmin(x, y) / t_0)) / t_0
	elif fmax(x, y) <= 4.3e+156:
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0))
	else:
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
	return tmp
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	tmp = 0.0
	if (fmax(x, y) <= -3.3e+51)
		tmp = Float64(Float64(Float64(fmax(x, y) / fmin(x, y)) * Float64(fmin(x, y) / t_0)) / t_0);
	elseif (fmax(x, y) <= 4.3e+156)
		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * t_0)));
	else
		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = max(x, y) + min(x, y);
	tmp = 0.0;
	if (max(x, y) <= -3.3e+51)
		tmp = ((max(x, y) / min(x, y)) * (min(x, y) / t_0)) / t_0;
	elseif (max(x, y) <= 4.3e+156)
		tmp = (max(x, y) / t_0) * (min(x, y) / ((t_0 - -1.0) * t_0));
	else
		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -3299999999999999711783531468410197741562225802346496], N[(N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}}{t\_0}\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\

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


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

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{y}{x}} \cdot \frac{x}{y + x}}{y + x} \]
    5. Step-by-step derivation
      1. lower-/.f6438.9%

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

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

    if -3.2999999999999997e51 < y < 4.2999999999999999e156

    1. Initial program 69.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\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{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
      22. metadata-eval93.1%

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

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

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

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

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

    if 4.2999999999999999e156 < y

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 96.7% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))))
  (if (<=
       (fmax x y)
       -3299999999999999711783531468410197741562225802346496)
    (/ (/ (fmax x y) (fmin x y)) t_0)
    (if (<=
         (fmax x y)
         4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232)
      (* (/ (fmax x y) t_0) (/ (fmin x y) (* (- t_0 -1) t_0)))
      (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0)))))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
	} else if (fmax(x, y) <= 4.3e+156) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
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) :: t_0
    real(8) :: tmp
    t_0 = fmax(x, y) + fmin(x, y)
    if (fmax(x, y) <= (-3.3d+51)) then
        tmp = (fmax(x, y) / fmin(x, y)) / t_0
    else if (fmax(x, y) <= 4.3d+156) then
        tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - (-1.0d0)) * t_0))
    else
        tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -3.3e+51) {
		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
	} else if (fmax(x, y) <= 4.3e+156) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0));
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	tmp = 0
	if fmax(x, y) <= -3.3e+51:
		tmp = (fmax(x, y) / fmin(x, y)) / t_0
	elif fmax(x, y) <= 4.3e+156:
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((t_0 - -1.0) * t_0))
	else:
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
	return tmp
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	tmp = 0.0
	if (fmax(x, y) <= -3.3e+51)
		tmp = Float64(Float64(fmax(x, y) / fmin(x, y)) / t_0);
	elseif (fmax(x, y) <= 4.3e+156)
		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * t_0)));
	else
		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = max(x, y) + min(x, y);
	tmp = 0.0;
	if (max(x, y) <= -3.3e+51)
		tmp = (max(x, y) / min(x, y)) / t_0;
	elseif (max(x, y) <= 4.3e+156)
		tmp = (max(x, y) / t_0) * (min(x, y) / ((t_0 - -1.0) * t_0));
	else
		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -3299999999999999711783531468410197741562225802346496], N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -3299999999999999711783531468410197741562225802346496:\\
\;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4299999999999999852229910743025374286144824664577899044937748399773491957481967274881552653588102504561910050557226899646186196015891287770503850859778015232:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0}\\

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


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

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
    7. Step-by-step derivation
      1. lower-/.f6438.5%

        \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
    8. Applied rewrites38.5%

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

    if -3.2999999999999997e51 < y < 4.2999999999999999e156

    1. Initial program 69.1%

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

        \[\leadsto \frac{\color{blue}{y \cdot x}}{\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{y \cdot x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
      5. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{y + x} \cdot \frac{x}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
      22. metadata-eval93.1%

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

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

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

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

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

    if 4.2999999999999999e156 < y

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.7% accurate, 0.0× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6096769324758911}{148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416}:\\ \;\;\;\;\frac{\frac{1}{\frac{1 + \mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{93530032661255}{1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{1 \cdot t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))))
  (if (<=
       (fmax x y)
       -6096769324758911/148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416)
    (/ (/ 1 (/ (+ 1 (fmin x y)) (fmax x y))) t_0)
    (if (<=
         (fmax x y)
         93530032661255/1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944)
      (* (/ (fmax x y) t_0) (/ (fmin x y) (* 1 t_0)))
      (if (<=
           (fmax x y)
           549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824)
        (* (/ (fmin x y) (* (- t_0 -1) (* t_0 t_0))) (fmax x y))
        (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0))))))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -4.1e-269) {
		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_0;
	} else if (fmax(x, y) <= 8.2e-179) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0));
	} else if (fmax(x, y) <= 5.5e+89) {
		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
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) :: t_0
    real(8) :: tmp
    t_0 = fmax(x, y) + fmin(x, y)
    if (fmax(x, y) <= (-4.1d-269)) then
        tmp = (1.0d0 / ((1.0d0 + fmin(x, y)) / fmax(x, y))) / t_0
    else if (fmax(x, y) <= 8.2d-179) then
        tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0d0 * t_0))
    else if (fmax(x, y) <= 5.5d+89) then
        tmp = (fmin(x, y) / ((t_0 - (-1.0d0)) * (t_0 * t_0))) * fmax(x, y)
    else
        tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= -4.1e-269) {
		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_0;
	} else if (fmax(x, y) <= 8.2e-179) {
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0));
	} else if (fmax(x, y) <= 5.5e+89) {
		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
	} else {
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
	}
	return tmp;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	tmp = 0
	if fmax(x, y) <= -4.1e-269:
		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_0
	elif fmax(x, y) <= 8.2e-179:
		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0))
	elif fmax(x, y) <= 5.5e+89:
		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y)
	else:
		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
	return tmp
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	tmp = 0.0
	if (fmax(x, y) <= -4.1e-269)
		tmp = Float64(Float64(1.0 / Float64(Float64(1.0 + fmin(x, y)) / fmax(x, y))) / t_0);
	elseif (fmax(x, y) <= 8.2e-179)
		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(1.0 * t_0)));
	elseif (fmax(x, y) <= 5.5e+89)
		tmp = Float64(Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * Float64(t_0 * t_0))) * fmax(x, y));
	else
		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
	end
	return tmp
end
function tmp_2 = code(x, y)
	t_0 = max(x, y) + min(x, y);
	tmp = 0.0;
	if (max(x, y) <= -4.1e-269)
		tmp = (1.0 / ((1.0 + min(x, y)) / max(x, y))) / t_0;
	elseif (max(x, y) <= 8.2e-179)
		tmp = (max(x, y) / t_0) * (min(x, y) / (1.0 * t_0));
	elseif (max(x, y) <= 5.5e+89)
		tmp = (min(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * max(x, y);
	else
		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -6096769324758911/148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416], N[(N[(1 / N[(N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 93530032661255/1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824], N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
\mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6096769324758911}{148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416}:\\
\;\;\;\;\frac{\frac{1}{\frac{1 + \mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}}{t\_0}\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{93530032661255}{1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{1 \cdot t\_0}\\

\mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\
\;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\

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


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

    1. Initial program 69.1%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. Step-by-step derivation
      1. 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)}} \]
      2. 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)} \]
      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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{\frac{1 + x}{y}}}{y + x} \]
    8. Applied rewrites50.8%

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

    if -4.1000000000000003e-269 < y < 8.1999999999999998e-179

    1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 8.1999999999999998e-179 < y < 5.4999999999999998e89

      1. Initial program 69.1%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Step-by-step derivation
        1. 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)}} \]
        2. mult-flipN/A

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

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

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

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

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

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

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

      if 5.4999999999999998e89 < y

      1. Initial program 69.1%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Step-by-step derivation
        1. 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)}} \]
        2. 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)} \]
        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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 91.8% accurate, 0.0× speedup?

    \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6096769324758911}{148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{93530032661255}{1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{1 \cdot t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
    (FPCore (x y)
      :precision binary64
      (let* ((t_0 (+ (fmax x y) (fmin x y))))
      (if (<=
           (fmax x y)
           -6096769324758911/148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416)
        (/ (/ (fmax x y) (+ 1 (fmin x y))) t_0)
        (if (<=
             (fmax x y)
             93530032661255/1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944)
          (* (/ (fmax x y) t_0) (/ (fmin x y) (* 1 t_0)))
          (if (<=
               (fmax x y)
               549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824)
            (* (/ (fmin x y) (* (- t_0 -1) (* t_0 t_0))) (fmax x y))
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0))))))
    double code(double x, double y) {
    	double t_0 = fmax(x, y) + fmin(x, y);
    	double tmp;
    	if (fmax(x, y) <= -4.1e-269) {
    		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
    	} else if (fmax(x, y) <= 8.2e-179) {
    		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0));
    	} else if (fmax(x, y) <= 5.5e+89) {
    		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
    	} else {
    		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
    	}
    	return tmp;
    }
    
    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) :: t_0
        real(8) :: tmp
        t_0 = fmax(x, y) + fmin(x, y)
        if (fmax(x, y) <= (-4.1d-269)) then
            tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_0
        else if (fmax(x, y) <= 8.2d-179) then
            tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0d0 * t_0))
        else if (fmax(x, y) <= 5.5d+89) then
            tmp = (fmin(x, y) / ((t_0 - (-1.0d0)) * (t_0 * t_0))) * fmax(x, y)
        else
            tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y) {
    	double t_0 = fmax(x, y) + fmin(x, y);
    	double tmp;
    	if (fmax(x, y) <= -4.1e-269) {
    		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
    	} else if (fmax(x, y) <= 8.2e-179) {
    		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0));
    	} else if (fmax(x, y) <= 5.5e+89) {
    		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
    	} else {
    		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
    	}
    	return tmp;
    }
    
    def code(x, y):
    	t_0 = fmax(x, y) + fmin(x, y)
    	tmp = 0
    	if fmax(x, y) <= -4.1e-269:
    		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0
    	elif fmax(x, y) <= 8.2e-179:
    		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / (1.0 * t_0))
    	elif fmax(x, y) <= 5.5e+89:
    		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y)
    	else:
    		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
    	return tmp
    
    function code(x, y)
    	t_0 = Float64(fmax(x, y) + fmin(x, y))
    	tmp = 0.0
    	if (fmax(x, y) <= -4.1e-269)
    		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_0);
    	elseif (fmax(x, y) <= 8.2e-179)
    		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(1.0 * t_0)));
    	elseif (fmax(x, y) <= 5.5e+89)
    		tmp = Float64(Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * Float64(t_0 * t_0))) * fmax(x, y));
    	else
    		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y)
    	t_0 = max(x, y) + min(x, y);
    	tmp = 0.0;
    	if (max(x, y) <= -4.1e-269)
    		tmp = (max(x, y) / (1.0 + min(x, y))) / t_0;
    	elseif (max(x, y) <= 8.2e-179)
    		tmp = (max(x, y) / t_0) * (min(x, y) / (1.0 * t_0));
    	elseif (max(x, y) <= 5.5e+89)
    		tmp = (min(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * max(x, y);
    	else
    		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -6096769324758911/148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 93530032661255/1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824], N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]]
    
    \begin{array}{l}
    t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
    \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6096769324758911}{148701690847778306279806249814990056013126020165939445905577185931594065716040437354516831449615635058979872379019297305045458524554490570779083058110239462578297084044745987394268640983429773687023919578235143720606774870687788008815709894034865808301204510545414391282376534881468416}:\\
    \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\
    
    \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{93530032661255}{1140610154405548804660292901425072831223307126812139982644798129474818791802169346626478202829342849944660577393398601827672176180343859499563165329930553547062998668590066237520718548061650944}:\\
    \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{1 \cdot t\_0}\\
    
    \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\
    \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y < -4.1000000000000003e-269

      1. Initial program 69.1%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. Step-by-step derivation
        1. 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)}} \]
        2. 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)} \]
        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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.1000000000000003e-269 < y < 8.1999999999999998e-179

      1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 8.1999999999999998e-179 < y < 5.4999999999999998e89

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. mult-flipN/A

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

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

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

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

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

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

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

        if 5.4999999999999998e89 < y

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 91.8% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\ t_1 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6703903964971299}{3351951982485649274893506249551461531869841455148098344430890360930441007518386744200468574541725856922507964546621512713438470702986642486608412251521024}:\\ \;\;\;\;\frac{\frac{1}{\frac{1 + \mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}}{t\_1}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{5609415803011879}{19342813113834066795298816}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_1}\\ \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (+ (fmin x y) (fmax x y)))
             (t_1 (+ (fmax x y) (fmin x y))))
        (if (<=
             (fmax x y)
             -6703903964971299/3351951982485649274893506249551461531869841455148098344430890360930441007518386744200468574541725856922507964546621512713438470702986642486608412251521024)
          (/ (/ 1 (/ (+ 1 (fmin x y)) (fmax x y))) t_1)
          (if (<= (fmax x y) 5609415803011879/19342813113834066795298816)
            (* (/ (fmax x y) t_0) (/ (fmin x y) (* (- (fmin x y) -1) t_0)))
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_1)))))
      double code(double x, double y) {
      	double t_0 = fmin(x, y) + fmax(x, y);
      	double t_1 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= -2e-138) {
      		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_1;
      	} else if (fmax(x, y) <= 2.9e-10) {
      		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((fmin(x, y) - -1.0) * t_0));
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1;
      	}
      	return tmp;
      }
      
      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) :: t_0
          real(8) :: t_1
          real(8) :: tmp
          t_0 = fmin(x, y) + fmax(x, y)
          t_1 = fmax(x, y) + fmin(x, y)
          if (fmax(x, y) <= (-2d-138)) then
              tmp = (1.0d0 / ((1.0d0 + fmin(x, y)) / fmax(x, y))) / t_1
          else if (fmax(x, y) <= 2.9d-10) then
              tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((fmin(x, y) - (-1.0d0)) * t_0))
          else
              tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double t_0 = fmin(x, y) + fmax(x, y);
      	double t_1 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= -2e-138) {
      		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_1;
      	} else if (fmax(x, y) <= 2.9e-10) {
      		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((fmin(x, y) - -1.0) * t_0));
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = fmin(x, y) + fmax(x, y)
      	t_1 = fmax(x, y) + fmin(x, y)
      	tmp = 0
      	if fmax(x, y) <= -2e-138:
      		tmp = (1.0 / ((1.0 + fmin(x, y)) / fmax(x, y))) / t_1
      	elif fmax(x, y) <= 2.9e-10:
      		tmp = (fmax(x, y) / t_0) * (fmin(x, y) / ((fmin(x, y) - -1.0) * t_0))
      	else:
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(fmin(x, y) + fmax(x, y))
      	t_1 = Float64(fmax(x, y) + fmin(x, y))
      	tmp = 0.0
      	if (fmax(x, y) <= -2e-138)
      		tmp = Float64(Float64(1.0 / Float64(Float64(1.0 + fmin(x, y)) / fmax(x, y))) / t_1);
      	elseif (fmax(x, y) <= 2.9e-10)
      		tmp = Float64(Float64(fmax(x, y) / t_0) * Float64(fmin(x, y) / Float64(Float64(fmin(x, y) - -1.0) * t_0)));
      	else
      		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_1);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = min(x, y) + max(x, y);
      	t_1 = max(x, y) + min(x, y);
      	tmp = 0.0;
      	if (max(x, y) <= -2e-138)
      		tmp = (1.0 / ((1.0 + min(x, y)) / max(x, y))) / t_1;
      	elseif (max(x, y) <= 2.9e-10)
      		tmp = (max(x, y) / t_0) * (min(x, y) / ((min(x, y) - -1.0) * t_0));
      	else
      		tmp = (min(x, y) / (1.0 + max(x, y))) / t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -6703903964971299/3351951982485649274893506249551461531869841455148098344430890360930441007518386744200468574541725856922507964546621512713438470702986642486608412251521024], N[(N[(1 / N[(N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 5609415803011879/19342813113834066795298816], N[(N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(N[(N[Min[x, y], $MachinePrecision] - -1), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
      t_1 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
      \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{-6703903964971299}{3351951982485649274893506249551461531869841455148098344430890360930441007518386744200468574541725856922507964546621512713438470702986642486608412251521024}:\\
      \;\;\;\;\frac{\frac{1}{\frac{1 + \mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}}{t\_1}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{5609415803011879}{19342813113834066795298816}:\\
      \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot t\_0}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_1}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -2.0000000000000001e-138

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{1}{\frac{1 + x}{y}}}{y + x} \]
        8. Applied rewrites50.8%

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

        if -2.0000000000000001e-138 < y < 2.8999999999999998e-10

        1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.8999999999999998e-10 < y

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 91.0% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (+ (fmax x y) (fmin x y))))
        (if (<=
             (fmax x y)
             5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424)
          (/ (/ (fmax x y) (+ 1 (fmin x y))) t_0)
          (if (<=
               (fmax x y)
               549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824)
            (* (/ (fmin x y) (* (- t_0 -1) (* t_0 t_0))) (fmax x y))
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0)))))
      double code(double x, double y) {
      	double t_0 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
      	} else if (fmax(x, y) <= 5.5e+89) {
      		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
      	}
      	return tmp;
      }
      
      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) :: t_0
          real(8) :: tmp
          t_0 = fmax(x, y) + fmin(x, y)
          if (fmax(x, y) <= 1.35d-156) then
              tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_0
          else if (fmax(x, y) <= 5.5d+89) then
              tmp = (fmin(x, y) / ((t_0 - (-1.0d0)) * (t_0 * t_0))) * fmax(x, y)
          else
              tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double t_0 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
      	} else if (fmax(x, y) <= 5.5e+89) {
      		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y);
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = fmax(x, y) + fmin(x, y)
      	tmp = 0
      	if fmax(x, y) <= 1.35e-156:
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0
      	elif fmax(x, y) <= 5.5e+89:
      		tmp = (fmin(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * fmax(x, y)
      	else:
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(fmax(x, y) + fmin(x, y))
      	tmp = 0.0
      	if (fmax(x, y) <= 1.35e-156)
      		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_0);
      	elseif (fmax(x, y) <= 5.5e+89)
      		tmp = Float64(Float64(fmin(x, y) / Float64(Float64(t_0 - -1.0) * Float64(t_0 * t_0))) * fmax(x, y));
      	else
      		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = max(x, y) + min(x, y);
      	tmp = 0.0;
      	if (max(x, y) <= 1.35e-156)
      		tmp = (max(x, y) / (1.0 + min(x, y))) / t_0;
      	elseif (max(x, y) <= 5.5e+89)
      		tmp = (min(x, y) / ((t_0 - -1.0) * (t_0 * t_0))) * max(x, y);
      	else
      		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824], N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
      \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\
      \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 549999999999999975912351386214315172737300348563729775990872558518068199501418732741197824:\\
      \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{max}\left(x, y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < 1.3500000000000001e-156

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.3500000000000001e-156 < y < 5.4999999999999998e89

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. mult-flipN/A

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

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

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

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

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

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

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

        if 5.4999999999999998e89 < y

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 9: 89.2% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\ t_1 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_1}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{5609415803011879}{19342813113834066795298816}:\\ \;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot \left(t\_0 \cdot t\_0\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_1}\\ \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (+ (fmin x y) (fmax x y)))
             (t_1 (+ (fmax x y) (fmin x y))))
        (if (<=
             (fmax x y)
             5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424)
          (/ (/ (fmax x y) (+ 1 (fmin x y))) t_1)
          (if (<= (fmax x y) 5609415803011879/19342813113834066795298816)
            (* (fmax x y) (/ (fmin x y) (* (- (fmin x y) -1) (* t_0 t_0))))
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_1)))))
      double code(double x, double y) {
      	double t_0 = fmin(x, y) + fmax(x, y);
      	double t_1 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_1;
      	} else if (fmax(x, y) <= 2.9e-10) {
      		tmp = fmax(x, y) * (fmin(x, y) / ((fmin(x, y) - -1.0) * (t_0 * t_0)));
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1;
      	}
      	return tmp;
      }
      
      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) :: t_0
          real(8) :: t_1
          real(8) :: tmp
          t_0 = fmin(x, y) + fmax(x, y)
          t_1 = fmax(x, y) + fmin(x, y)
          if (fmax(x, y) <= 1.35d-156) then
              tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_1
          else if (fmax(x, y) <= 2.9d-10) then
              tmp = fmax(x, y) * (fmin(x, y) / ((fmin(x, y) - (-1.0d0)) * (t_0 * t_0)))
          else
              tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double t_0 = fmin(x, y) + fmax(x, y);
      	double t_1 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_1;
      	} else if (fmax(x, y) <= 2.9e-10) {
      		tmp = fmax(x, y) * (fmin(x, y) / ((fmin(x, y) - -1.0) * (t_0 * t_0)));
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = fmin(x, y) + fmax(x, y)
      	t_1 = fmax(x, y) + fmin(x, y)
      	tmp = 0
      	if fmax(x, y) <= 1.35e-156:
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_1
      	elif fmax(x, y) <= 2.9e-10:
      		tmp = fmax(x, y) * (fmin(x, y) / ((fmin(x, y) - -1.0) * (t_0 * t_0)))
      	else:
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_1
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(fmin(x, y) + fmax(x, y))
      	t_1 = Float64(fmax(x, y) + fmin(x, y))
      	tmp = 0.0
      	if (fmax(x, y) <= 1.35e-156)
      		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_1);
      	elseif (fmax(x, y) <= 2.9e-10)
      		tmp = Float64(fmax(x, y) * Float64(fmin(x, y) / Float64(Float64(fmin(x, y) - -1.0) * Float64(t_0 * t_0))));
      	else
      		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_1);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = min(x, y) + max(x, y);
      	t_1 = max(x, y) + min(x, y);
      	tmp = 0.0;
      	if (max(x, y) <= 1.35e-156)
      		tmp = (max(x, y) / (1.0 + min(x, y))) / t_1;
      	elseif (max(x, y) <= 2.9e-10)
      		tmp = max(x, y) * (min(x, y) / ((min(x, y) - -1.0) * (t_0 * t_0)));
      	else
      		tmp = (min(x, y) / (1.0 + max(x, y))) / t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 5609415803011879/19342813113834066795298816], N[(N[Max[x, y], $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / N[(N[(N[Min[x, y], $MachinePrecision] - -1), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
      t_1 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
      \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\
      \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_1}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{5609415803011879}{19342813113834066795298816}:\\
      \;\;\;\;\mathsf{max}\left(x, y\right) \cdot \frac{\mathsf{min}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot \left(t\_0 \cdot t\_0\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_1}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < 1.3500000000000001e-156

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.3500000000000001e-156 < y < 2.8999999999999998e-10

        1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto y \cdot \frac{x}{\left(x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
          13. metadata-evalN/A

            \[\leadsto y \cdot \frac{x}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
          14. lower--.f6474.9%

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

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

        if 2.8999999999999998e-10 < y

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 10: 87.2% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{974877780937237}{309485009821345068724781056}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{1 \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{min}\left(x, y\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (+ (fmax x y) (fmin x y))))
        (if (<=
             (fmax x y)
             5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424)
          (/ (/ (fmax x y) (+ 1 (fmin x y))) t_0)
          (if (<= (fmax x y) 974877780937237/309485009821345068724781056)
            (* (/ (fmax x y) (* 1 (* t_0 t_0))) (fmin x y))
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0)))))
      double code(double x, double y) {
      	double t_0 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
      	} else if (fmax(x, y) <= 3.15e-12) {
      		tmp = (fmax(x, y) / (1.0 * (t_0 * t_0))) * fmin(x, y);
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
      	}
      	return tmp;
      }
      
      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) :: t_0
          real(8) :: tmp
          t_0 = fmax(x, y) + fmin(x, y)
          if (fmax(x, y) <= 1.35d-156) then
              tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_0
          else if (fmax(x, y) <= 3.15d-12) then
              tmp = (fmax(x, y) / (1.0d0 * (t_0 * t_0))) * fmin(x, y)
          else
              tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y) {
      	double t_0 = fmax(x, y) + fmin(x, y);
      	double tmp;
      	if (fmax(x, y) <= 1.35e-156) {
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
      	} else if (fmax(x, y) <= 3.15e-12) {
      		tmp = (fmax(x, y) / (1.0 * (t_0 * t_0))) * fmin(x, y);
      	} else {
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
      	}
      	return tmp;
      }
      
      def code(x, y):
      	t_0 = fmax(x, y) + fmin(x, y)
      	tmp = 0
      	if fmax(x, y) <= 1.35e-156:
      		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0
      	elif fmax(x, y) <= 3.15e-12:
      		tmp = (fmax(x, y) / (1.0 * (t_0 * t_0))) * fmin(x, y)
      	else:
      		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
      	return tmp
      
      function code(x, y)
      	t_0 = Float64(fmax(x, y) + fmin(x, y))
      	tmp = 0.0
      	if (fmax(x, y) <= 1.35e-156)
      		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_0);
      	elseif (fmax(x, y) <= 3.15e-12)
      		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 * Float64(t_0 * t_0))) * fmin(x, y));
      	else
      		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y)
      	t_0 = max(x, y) + min(x, y);
      	tmp = 0.0;
      	if (max(x, y) <= 1.35e-156)
      		tmp = (max(x, y) / (1.0 + min(x, y))) / t_0;
      	elseif (max(x, y) <= 3.15e-12)
      		tmp = (max(x, y) / (1.0 * (t_0 * t_0))) * min(x, y);
      	else
      		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 5217125656073299/3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 974877780937237/309485009821345068724781056], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
      \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{5217125656073299}{3864537523017258344695351890931987344298927329706434998657235251451519142289560424536193766581922577962463616031502177177365078661042987655742908673467080748696980814823424}:\\
      \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{974877780937237}{309485009821345068724781056}:\\
      \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{1 \cdot \left(t\_0 \cdot t\_0\right)} \cdot \mathsf{min}\left(x, y\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < 1.3500000000000001e-156

        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.3500000000000001e-156 < y < 3.1500000000000001e-12

        1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.1500000000000001e-12 < y

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 11: 82.0% accurate, 0.1× speedup?

        \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -38000000000000000000:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (let* ((t_0 (+ (fmax x y) (fmin x y))))
          (if (<= (fmax x y) -38000000000000000000)
            (/ (/ (fmax x y) (fmin x y)) t_0)
            (if (<=
                 (fmax x y)
                 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
              (/ (fmax x y) (* (fmin x y) (+ 1 (fmin x y))))
              (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0)))))
        double code(double x, double y) {
        	double t_0 = fmax(x, y) + fmin(x, y);
        	double tmp;
        	if (fmax(x, y) <= -3.8e+19) {
        		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
        	} else if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
        	}
        	return tmp;
        }
        
        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) :: t_0
            real(8) :: tmp
            t_0 = fmax(x, y) + fmin(x, y)
            if (fmax(x, y) <= (-3.8d+19)) then
                tmp = (fmax(x, y) / fmin(x, y)) / t_0
            else if (fmax(x, y) <= 1d-153) then
                tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
            else
                tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double t_0 = fmax(x, y) + fmin(x, y);
        	double tmp;
        	if (fmax(x, y) <= -3.8e+19) {
        		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
        	} else if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = fmax(x, y) + fmin(x, y)
        	tmp = 0
        	if fmax(x, y) <= -3.8e+19:
        		tmp = (fmax(x, y) / fmin(x, y)) / t_0
        	elif fmax(x, y) <= 1e-153:
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)))
        	else:
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(fmax(x, y) + fmin(x, y))
        	tmp = 0.0
        	if (fmax(x, y) <= -3.8e+19)
        		tmp = Float64(Float64(fmax(x, y) / fmin(x, y)) / t_0);
        	elseif (fmax(x, y) <= 1e-153)
        		tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y))));
        	else
        		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = max(x, y) + min(x, y);
        	tmp = 0.0;
        	if (max(x, y) <= -3.8e+19)
        		tmp = (max(x, y) / min(x, y)) / t_0;
        	elseif (max(x, y) <= 1e-153)
        		tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y)));
        	else
        		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], -38000000000000000000], N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
        
        \begin{array}{l}
        t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -38000000000000000000:\\
        \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\
        
        \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -3.8e19

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
          7. Step-by-step derivation
            1. lower-/.f6438.5%

              \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
          8. Applied rewrites38.5%

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

          if -3.8e19 < y < 1e-153

          1. Initial program 69.1%

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

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

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

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

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

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

          if 1e-153 < y

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 82.0% accurate, 0.1× speedup?

        \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (let* ((t_0 (+ (fmax x y) (fmin x y))))
          (if (<=
               (fmax x y)
               7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
            (/ (/ (fmax x y) (+ 1 (fmin x y))) t_0)
            (/ (/ (fmin x y) (+ 1 (fmax x y))) t_0))))
        double code(double x, double y) {
        	double t_0 = fmax(x, y) + fmin(x, y);
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
        	} else {
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
        	}
        	return tmp;
        }
        
        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) :: t_0
            real(8) :: tmp
            t_0 = fmax(x, y) + fmin(x, y)
            if (fmax(x, y) <= 1d-153) then
                tmp = (fmax(x, y) / (1.0d0 + fmin(x, y))) / t_0
            else
                tmp = (fmin(x, y) / (1.0d0 + fmax(x, y))) / t_0
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double t_0 = fmax(x, y) + fmin(x, y);
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0;
        	} else {
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0;
        	}
        	return tmp;
        }
        
        def code(x, y):
        	t_0 = fmax(x, y) + fmin(x, y)
        	tmp = 0
        	if fmax(x, y) <= 1e-153:
        		tmp = (fmax(x, y) / (1.0 + fmin(x, y))) / t_0
        	else:
        		tmp = (fmin(x, y) / (1.0 + fmax(x, y))) / t_0
        	return tmp
        
        function code(x, y)
        	t_0 = Float64(fmax(x, y) + fmin(x, y))
        	tmp = 0.0
        	if (fmax(x, y) <= 1e-153)
        		tmp = Float64(Float64(fmax(x, y) / Float64(1.0 + fmin(x, y))) / t_0);
        	else
        		tmp = Float64(Float64(fmin(x, y) / Float64(1.0 + fmax(x, y))) / t_0);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	t_0 = max(x, y) + min(x, y);
        	tmp = 0.0;
        	if (max(x, y) <= 1e-153)
        		tmp = (max(x, y) / (1.0 + min(x, y))) / t_0;
        	else
        		tmp = (min(x, y) / (1.0 + max(x, y))) / t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := Block[{t$95$0 = N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]]
        
        \begin{array}{l}
        t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{1 + \mathsf{min}\left(x, y\right)}}{t\_0}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{1 + \mathsf{max}\left(x, y\right)}}{t\_0}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < 1e-153

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1e-153 < y

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 13: 81.8% accurate, 0.1× speedup?

        \[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -38000000000000000000:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) - -1}}{\mathsf{max}\left(x, y\right)}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (if (<= (fmax x y) -38000000000000000000)
          (/ (/ (fmax x y) (fmin x y)) (+ (fmax x y) (fmin x y)))
          (if (<=
               (fmax x y)
               7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
            (/ (fmax x y) (* (fmin x y) (+ 1 (fmin x y))))
            (/ (/ (fmin x y) (- (fmax x y) -1)) (fmax x y)))))
        double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= -3.8e+19) {
        		tmp = (fmax(x, y) / fmin(x, y)) / (fmax(x, y) + fmin(x, y));
        	} else if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y);
        	}
        	return tmp;
        }
        
        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 (fmax(x, y) <= (-3.8d+19)) then
                tmp = (fmax(x, y) / fmin(x, y)) / (fmax(x, y) + fmin(x, y))
            else if (fmax(x, y) <= 1d-153) then
                tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
            else
                tmp = (fmin(x, y) / (fmax(x, y) - (-1.0d0))) / fmax(x, y)
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= -3.8e+19) {
        		tmp = (fmax(x, y) / fmin(x, y)) / (fmax(x, y) + fmin(x, y));
        	} else if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y);
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if fmax(x, y) <= -3.8e+19:
        		tmp = (fmax(x, y) / fmin(x, y)) / (fmax(x, y) + fmin(x, y))
        	elif fmax(x, y) <= 1e-153:
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)))
        	else:
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y)
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (fmax(x, y) <= -3.8e+19)
        		tmp = Float64(Float64(fmax(x, y) / fmin(x, y)) / Float64(fmax(x, y) + fmin(x, y)));
        	elseif (fmax(x, y) <= 1e-153)
        		tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y))));
        	else
        		tmp = Float64(Float64(fmin(x, y) / Float64(fmax(x, y) - -1.0)) / fmax(x, y));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (max(x, y) <= -3.8e+19)
        		tmp = (max(x, y) / min(x, y)) / (max(x, y) + min(x, y));
        	elseif (max(x, y) <= 1e-153)
        		tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y)));
        	else
        		tmp = (min(x, y) / (max(x, y) - -1.0)) / max(x, y);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], -38000000000000000000], N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq -38000000000000000000:\\
        \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)}\\
        
        \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) - -1}}{\mathsf{max}\left(x, y\right)}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -3.8e19

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
          7. Step-by-step derivation
            1. lower-/.f6438.5%

              \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
          8. Applied rewrites38.5%

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

          if -3.8e19 < y < 1e-153

          1. Initial program 69.1%

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

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

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

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

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

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

          if 1e-153 < y

          1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
            6. lower-/.f6450.4%

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

              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
            8. +-commutativeN/A

              \[\leadsto \frac{\frac{x}{y + 1}}{y} \]
            9. add-flip-revN/A

              \[\leadsto \frac{\frac{x}{y - \left(\mathsf{neg}\left(1\right)\right)}}{y} \]
            10. metadata-evalN/A

              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
            11. lower--.f6450.4%

              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
          6. Applied rewrites50.4%

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

        Alternative 14: 80.3% accurate, 0.1× speedup?

        \[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) - -1}}{\mathsf{max}\left(x, y\right)}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (if (<=
             (fmax x y)
             7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
          (/ (fmax x y) (* (fmin x y) (+ 1 (fmin x y))))
          (/ (/ (fmin x y) (- (fmax x y) -1)) (fmax x y))))
        double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y);
        	}
        	return tmp;
        }
        
        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 (fmax(x, y) <= 1d-153) then
                tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
            else
                tmp = (fmin(x, y) / (fmax(x, y) - (-1.0d0))) / fmax(x, y)
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y);
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if fmax(x, y) <= 1e-153:
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)))
        	else:
        		tmp = (fmin(x, y) / (fmax(x, y) - -1.0)) / fmax(x, y)
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (fmax(x, y) <= 1e-153)
        		tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y))));
        	else
        		tmp = Float64(Float64(fmin(x, y) / Float64(fmax(x, y) - -1.0)) / fmax(x, y));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (max(x, y) <= 1e-153)
        		tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y)));
        	else
        		tmp = (min(x, y) / (max(x, y) - -1.0)) / max(x, y);
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1), $MachinePrecision]), $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) - -1}}{\mathsf{max}\left(x, y\right)}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < 1e-153

          1. Initial program 69.1%

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

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

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

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

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

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

          if 1e-153 < y

          1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
            6. lower-/.f6450.4%

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

              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
            8. +-commutativeN/A

              \[\leadsto \frac{\frac{x}{y + 1}}{y} \]
            9. add-flip-revN/A

              \[\leadsto \frac{\frac{x}{y - \left(\mathsf{neg}\left(1\right)\right)}}{y} \]
            10. metadata-evalN/A

              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
            11. lower--.f6450.4%

              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
          6. Applied rewrites50.4%

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

        Alternative 15: 78.0% accurate, 0.1× speedup?

        \[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \left(1 + \mathsf{max}\left(x, y\right)\right)}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (if (<=
             (fmax x y)
             7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
          (/ (fmax x y) (* (fmin x y) (+ 1 (fmin x y))))
          (/ (fmin x y) (* (fmax x y) (+ 1 (fmax x y))))))
        double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
        	}
        	return tmp;
        }
        
        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 (fmax(x, y) <= 1d-153) then
                tmp = fmax(x, y) / (fmin(x, y) * (1.0d0 + fmin(x, y)))
            else
                tmp = fmin(x, y) / (fmax(x, y) * (1.0d0 + fmax(x, y)))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)));
        	} else {
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if fmax(x, y) <= 1e-153:
        		tmp = fmax(x, y) / (fmin(x, y) * (1.0 + fmin(x, y)))
        	else:
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)))
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (fmax(x, y) <= 1e-153)
        		tmp = Float64(fmax(x, y) / Float64(fmin(x, y) * Float64(1.0 + fmin(x, y))));
        	else
        		tmp = Float64(fmin(x, y) / Float64(fmax(x, y) * Float64(1.0 + fmax(x, y))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (max(x, y) <= 1e-153)
        		tmp = max(x, y) / (min(x, y) * (1.0 + min(x, y)));
        	else
        		tmp = min(x, y) / (max(x, y) * (1.0 + max(x, y)));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[Max[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] * N[(1 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] * N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right) \cdot \left(1 + \mathsf{min}\left(x, y\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \left(1 + \mathsf{max}\left(x, y\right)\right)}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < 1e-153

          1. Initial program 69.1%

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

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

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

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

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

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

          if 1e-153 < y

          1. Initial program 69.1%

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

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

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

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

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

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

        Alternative 16: 65.7% accurate, 0.1× speedup?

        \[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \left(1 + \mathsf{max}\left(x, y\right)\right)}\\ \end{array} \]
        (FPCore (x y)
          :precision binary64
          (if (<=
             (fmax x y)
             7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952)
          (/ (fmax x y) (fmin x y))
          (/ (fmin x y) (* (fmax x y) (+ 1 (fmax x y))))))
        double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / fmin(x, y);
        	} else {
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
        	}
        	return tmp;
        }
        
        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 (fmax(x, y) <= 1d-153) then
                tmp = fmax(x, y) / fmin(x, y)
            else
                tmp = fmin(x, y) / (fmax(x, y) * (1.0d0 + fmax(x, y)))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y) {
        	double tmp;
        	if (fmax(x, y) <= 1e-153) {
        		tmp = fmax(x, y) / fmin(x, y);
        	} else {
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)));
        	}
        	return tmp;
        }
        
        def code(x, y):
        	tmp = 0
        	if fmax(x, y) <= 1e-153:
        		tmp = fmax(x, y) / fmin(x, y)
        	else:
        		tmp = fmin(x, y) / (fmax(x, y) * (1.0 + fmax(x, y)))
        	return tmp
        
        function code(x, y)
        	tmp = 0.0
        	if (fmax(x, y) <= 1e-153)
        		tmp = Float64(fmax(x, y) / fmin(x, y));
        	else
        		tmp = Float64(fmin(x, y) / Float64(fmax(x, y) * Float64(1.0 + fmax(x, y))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y)
        	tmp = 0.0;
        	if (max(x, y) <= 1e-153)
        		tmp = max(x, y) / min(x, y);
        	else
        		tmp = min(x, y) / (max(x, y) * (1.0 + max(x, y)));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_] := If[LessEqual[N[Max[x, y], $MachinePrecision], 7547924849643083/7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952], N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Min[x, y], $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] * N[(1 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq \frac{7547924849643083}{7547924849643082704483109161976537781833842440832880856752412600491248324784297704172253450355317535082936750061527689799541169259849585265122868502865392087298790653952}:\\
        \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right) \cdot \left(1 + \mathsf{max}\left(x, y\right)\right)}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < 1e-153

          1. Initial program 69.1%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. Step-by-step derivation
            1. 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)}} \]
            2. 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)} \]
            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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{y}{\color{blue}{x}} \]
          10. Step-by-step derivation
            1. lower-/.f6426.3%

              \[\leadsto \frac{y}{x} \]
          11. Applied rewrites26.3%

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

          if 1e-153 < y

          1. Initial program 69.1%

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

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

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

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

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

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

        Alternative 17: 26.3% accurate, 0.2× speedup?

        \[\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)} \]
        (FPCore (x y)
          :precision binary64
          (/ (fmax x y) (fmin x y)))
        double code(double x, double y) {
        	return fmax(x, y) / fmin(x, y);
        }
        
        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 = fmax(x, y) / fmin(x, y)
        end function
        
        public static double code(double x, double y) {
        	return fmax(x, y) / fmin(x, y);
        }
        
        def code(x, y):
        	return fmax(x, y) / fmin(x, y)
        
        function code(x, y)
        	return Float64(fmax(x, y) / fmin(x, y))
        end
        
        function tmp = code(x, y)
        	tmp = max(x, y) / min(x, y);
        end
        
        code[x_, y_] := N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision]
        
        \frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}
        
        Derivation
        1. Initial program 69.1%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. Step-by-step derivation
          1. 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)}} \]
          2. 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)} \]
          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. times-fracN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{y}{\color{blue}{x}} \]
        10. Step-by-step derivation
          1. lower-/.f6426.3%

            \[\leadsto \frac{y}{x} \]
        11. Applied rewrites26.3%

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

        Reproduce

        ?
        herbie shell --seed 2025271 -o generate:evaluate
        (FPCore (x y)
          :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
          :precision binary64
          (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1))))