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

Percentage Accurate: 69.3% → 99.8%
Time: 4.3s
Alternatives: 20
Speedup: 0.8×

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.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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 20 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.3% 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.0))))
double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y):
	return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y)
	return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)))
end
function tmp = code(x, y)
	tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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.8× speedup?

\[\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{y + x} \]
(FPCore (x y)
  :precision binary64
  (/ (/ (* y (/ x (+ y x))) (- (+ y x) -1.0)) (+ y x)))
double code(double x, double y) {
	return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((y * (x / (y + x))) / ((y + x) - (-1.0d0))) / (y + x)
end function
public static double code(double x, double y) {
	return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x);
}
def code(x, y):
	return ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x)
function code(x, y)
	return Float64(Float64(Float64(y * Float64(x / Float64(y + x))) / Float64(Float64(y + x) - -1.0)) / Float64(y + x))
end
function tmp = code(x, y)
	tmp = ((y * (x / (y + x))) / ((y + x) - -1.0)) / (y + x);
end
code[x_, y_] := N[(N[(N[(y * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{y + x}
Derivation
  1. Initial program 69.3%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 0.8× speedup?

\[\frac{\frac{y}{\left(y + x\right) - -1} \cdot \frac{x}{y + x}}{y + x} \]
(FPCore (x y)
  :precision binary64
  (/ (* (/ y (- (+ y x) -1.0)) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
	return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((y / ((y + x) - (-1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
	return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
}
def code(x, y):
	return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x)
function code(x, y)
	return Float64(Float64(Float64(y / Float64(Float64(y + x) - -1.0)) * Float64(x / Float64(y + x))) / Float64(y + x))
end
function tmp = code(x, y)
	tmp = ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
end
code[x_, y_] := N[(N[(N[(y / N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\frac{\frac{y}{\left(y + x\right) - -1} \cdot \frac{x}{y + x}}{y + x}
Derivation
  1. Initial program 69.3%

    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
  2. 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 3: 95.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 1.25 \cdot 10^{+166}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)}}{\left(-1 - \mathsf{min}\left(x, y\right)\right) - \mathsf{max}\left(x, y\right)} \cdot \left(\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)} - 1\right)\\ \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (+ (fmax x y) (fmin x y))))
  (if (<= (fmax x y) 1.25e+166)
    (* (/ (fmax x y) (* (- t_0 -1.0) t_0)) (/ (fmin x y) t_0))
    (*
     (/
      (/ (fmin x y) (+ (fmin x y) (fmax x y)))
      (- (- -1.0 (fmin x y)) (fmax x y)))
     (- (/ (fmin x y) (fmax x y)) 1.0)))))
double code(double x, double y) {
	double t_0 = fmax(x, y) + fmin(x, y);
	double tmp;
	if (fmax(x, y) <= 1.25e+166) {
		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
	} else {
		tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.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.25d+166) then
        tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * (fmin(x, y) / t_0)
    else
        tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / (((-1.0d0) - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0d0)
    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.25e+166) {
		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0);
	} else {
		tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0);
	}
	return tmp;
}
def code(x, y):
	t_0 = fmax(x, y) + fmin(x, y)
	tmp = 0
	if fmax(x, y) <= 1.25e+166:
		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * (fmin(x, y) / t_0)
	else:
		tmp = ((fmin(x, y) / (fmin(x, y) + fmax(x, y))) / ((-1.0 - fmin(x, y)) - fmax(x, y))) * ((fmin(x, y) / fmax(x, y)) - 1.0)
	return tmp
function code(x, y)
	t_0 = Float64(fmax(x, y) + fmin(x, y))
	tmp = 0.0
	if (fmax(x, y) <= 1.25e+166)
		tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * Float64(fmin(x, y) / t_0));
	else
		tmp = Float64(Float64(Float64(fmin(x, y) / Float64(fmin(x, y) + fmax(x, y))) / Float64(Float64(-1.0 - fmin(x, y)) - fmax(x, y))) * Float64(Float64(fmin(x, y) / fmax(x, y)) - 1.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.25e+166)
		tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * (min(x, y) / t_0);
	else
		tmp = ((min(x, y) / (min(x, y) + max(x, y))) / ((-1.0 - min(x, y)) - max(x, y))) * ((min(x, y) / max(x, y)) - 1.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], 1.25e+166], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Min[x, y], $MachinePrecision] / N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 - N[Min[x, y], $MachinePrecision]), $MachinePrecision] - N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $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 1.25 \cdot 10^{+166}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\mathsf{min}\left(x, y\right)}{t\_0}\\

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


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

    1. Initial program 69.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

    if 1.25e166 < y

    1. Initial program 69.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 95.6% 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)\\ t_2 := \mathsf{max}\left(x, y\right) - -1\\ \mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.4 \cdot 10^{+159}:\\ \;\;\;\;\frac{1}{t\_2 + \mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{max}\left(x, y\right)}{t\_0}\\ \mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -9.8 \cdot 10^{-11}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_1 - -1\right) \cdot t\_1} \cdot 1\\ \mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 4.7 \cdot 10^{+52}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{t\_2 \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)))
       (t_2 (- (fmax x y) -1.0)))
  (if (<= (fmin x y) -1.4e+159)
    (* (/ 1.0 (+ t_2 (fmin x y))) (/ (fmax x y) t_0))
    (if (<= (fmin x y) -9.8e-11)
      (* (/ (fmax x y) (* (- t_1 -1.0) t_1)) 1.0)
      (if (<= (fmin x y) 4.7e+52)
        (/ (* (/ (fmin x y) t_0) (fmax x y)) (* t_2 t_0))
        (/ (/ (fmin x y) (+ 1.0 (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 t_2 = fmax(x, y) - -1.0;
	double tmp;
	if (fmin(x, y) <= -1.4e+159) {
		tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0);
	} else if (fmin(x, y) <= -9.8e-11) {
		tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0;
	} else if (fmin(x, y) <= 4.7e+52) {
		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * 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) :: t_2
    real(8) :: tmp
    t_0 = fmin(x, y) + fmax(x, y)
    t_1 = fmax(x, y) + fmin(x, y)
    t_2 = fmax(x, y) - (-1.0d0)
    if (fmin(x, y) <= (-1.4d+159)) then
        tmp = (1.0d0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0)
    else if (fmin(x, y) <= (-9.8d-11)) then
        tmp = (fmax(x, y) / ((t_1 - (-1.0d0)) * t_1)) * 1.0d0
    else if (fmin(x, y) <= 4.7d+52) then
        tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * 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 t_2 = fmax(x, y) - -1.0;
	double tmp;
	if (fmin(x, y) <= -1.4e+159) {
		tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0);
	} else if (fmin(x, y) <= -9.8e-11) {
		tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0;
	} else if (fmin(x, y) <= 4.7e+52) {
		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * 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)
	t_2 = fmax(x, y) - -1.0
	tmp = 0
	if fmin(x, y) <= -1.4e+159:
		tmp = (1.0 / (t_2 + fmin(x, y))) * (fmax(x, y) / t_0)
	elif fmin(x, y) <= -9.8e-11:
		tmp = (fmax(x, y) / ((t_1 - -1.0) * t_1)) * 1.0
	elif fmin(x, y) <= 4.7e+52:
		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / (t_2 * 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))
	t_2 = Float64(fmax(x, y) - -1.0)
	tmp = 0.0
	if (fmin(x, y) <= -1.4e+159)
		tmp = Float64(Float64(1.0 / Float64(t_2 + fmin(x, y))) * Float64(fmax(x, y) / t_0));
	elseif (fmin(x, y) <= -9.8e-11)
		tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_1 - -1.0) * t_1)) * 1.0);
	elseif (fmin(x, y) <= 4.7e+52)
		tmp = Float64(Float64(Float64(fmin(x, y) / t_0) * fmax(x, y)) / Float64(t_2 * 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);
	t_2 = max(x, y) - -1.0;
	tmp = 0.0;
	if (min(x, y) <= -1.4e+159)
		tmp = (1.0 / (t_2 + min(x, y))) * (max(x, y) / t_0);
	elseif (min(x, y) <= -9.8e-11)
		tmp = (max(x, y) / ((t_1 - -1.0) * t_1)) * 1.0;
	elseif (min(x, y) <= 4.7e+52)
		tmp = ((min(x, y) / t_0) * max(x, y)) / (t_2 * 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]}, Block[{t$95$2 = N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]}, If[LessEqual[N[Min[x, y], $MachinePrecision], -1.4e+159], N[(N[(1.0 / N[(t$95$2 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Max[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], -9.8e-11], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$1 - -1.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], 4.7e+52], N[(N[(N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + 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)\\
t_2 := \mathsf{max}\left(x, y\right) - -1\\
\mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.4 \cdot 10^{+159}:\\
\;\;\;\;\frac{1}{t\_2 + \mathsf{min}\left(x, y\right)} \cdot \frac{\mathsf{max}\left(x, y\right)}{t\_0}\\

\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -9.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_1 - -1\right) \cdot t\_1} \cdot 1\\

\mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq 4.7 \cdot 10^{+52}:\\
\;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{t\_2 \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 4 regimes
  2. if x < -1.4000000000000001e159

    1. Initial program 69.3%

      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
    2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.4000000000000001e159 < x < -9.7999999999999998e-11

      1. Initial program 69.3%

        \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
      2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

        if -9.7999999999999998e-11 < x < 4.7e52

        1. Initial program 69.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 4.7e52 < x

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

      Alternative 5: 95.6% accurate, 0.0× speedup?

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

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

        if 1.25e166 < y

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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}{\left(y + x\right) - -1} \cdot \color{blue}{\frac{x}{y}}}{y + x} \]
        5. Step-by-step derivation
          1. lower-/.f6451.0%

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

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

      Alternative 6: 94.9% 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 1.25 \cdot 10^{+166}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\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) 1.25e+166)
          (* (/ (fmax x y) (* (- t_0 -1.0) t_0)) (/ (fmin x y) t_0))
          (/ (/ (fmin x y) (+ 1.0 (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.25e+166) {
      		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_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) <= 1.25d+166) then
              tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * (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) <= 1.25e+166) {
      		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_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) <= 1.25e+166:
      		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_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) <= 1.25e+166)
      		tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * Float64(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) <= 1.25e+166)
      		tmp = (max(x, y) / ((t_0 - -1.0) * t_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], 1.25e+166], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + 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 1.25 \cdot 10^{+166}:\\
      \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot \frac{\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 < 1.25e166

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

        if 1.25e166 < y

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

      Alternative 7: 94.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 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \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) 2e-20)
          (/ (* (/ (fmin x y) t_0) (fmax x y)) (* (- (fmin x y) -1.0) t_0))
          (if (<= (fmax x y) 4.2e+107)
            (* (/ (fmax x y) (* (- t_0 -1.0) (* t_0 t_0))) (fmin x y))
            (/ (/ (fmin x y) (+ 1.0 (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) <= 2e-20) {
      		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0);
      	} else if (fmax(x, y) <= 4.2e+107) {
      		tmp = (fmax(x, y) / ((t_0 - -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) <= 2d-20) then
              tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - (-1.0d0)) * t_0)
          else if (fmax(x, y) <= 4.2d+107) then
              tmp = (fmax(x, y) / ((t_0 - (-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) <= 2e-20) {
      		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0);
      	} else if (fmax(x, y) <= 4.2e+107) {
      		tmp = (fmax(x, y) / ((t_0 - -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) <= 2e-20:
      		tmp = ((fmin(x, y) / t_0) * fmax(x, y)) / ((fmin(x, y) - -1.0) * t_0)
      	elif fmax(x, y) <= 4.2e+107:
      		tmp = (fmax(x, y) / ((t_0 - -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) <= 2e-20)
      		tmp = Float64(Float64(Float64(fmin(x, y) / t_0) * fmax(x, y)) / Float64(Float64(fmin(x, y) - -1.0) * t_0));
      	elseif (fmax(x, y) <= 4.2e+107)
      		tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -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) <= 2e-20)
      		tmp = ((min(x, y) / t_0) * max(x, y)) / ((min(x, y) - -1.0) * t_0);
      	elseif (max(x, y) <= 4.2e+107)
      		tmp = (max(x, y) / ((t_0 - -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], 2e-20], N[(N[(N[(N[Min[x, y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Min[x, y], $MachinePrecision] - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4.2e+107], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * 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.0 + 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 2 \cdot 10^{-20}:\\
      \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{t\_0} \cdot \mathsf{max}\left(x, y\right)}{\left(\mathsf{min}\left(x, y\right) - -1\right) \cdot t\_0}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\
      \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \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.9999999999999999e-20

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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 y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.9999999999999999e-20 < y < 4.1999999999999999e107

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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. associate-/l*N/A

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

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

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

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

        if 4.1999999999999999e107 < y

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

      Alternative 8: 93.8% accurate, 0.0× speedup?

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

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.1799999999999999e86 < y

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

      Alternative 9: 91.3% accurate, 0.0× speedup?

      \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ t_1 := t\_0 - -1\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 5.2 \cdot 10^{-179}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_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))) (t_1 (- t_0 -1.0)))
        (if (<= (fmax x y) 5.2e-179)
          (/ (/ (* (fmax x y) 1.0) t_1) t_0)
          (if (<= (fmax x y) 4.2e+107)
            (* (/ (fmax x y) (* t_1 (* t_0 t_0))) (fmin x y))
            (/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0)))))
      double code(double x, double y) {
      	double t_0 = fmax(x, y) + fmin(x, y);
      	double t_1 = t_0 - -1.0;
      	double tmp;
      	if (fmax(x, y) <= 5.2e-179) {
      		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
      	} else if (fmax(x, y) <= 4.2e+107) {
      		tmp = (fmax(x, y) / (t_1 * (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) :: t_1
          real(8) :: tmp
          t_0 = fmax(x, y) + fmin(x, y)
          t_1 = t_0 - (-1.0d0)
          if (fmax(x, y) <= 5.2d-179) then
              tmp = ((fmax(x, y) * 1.0d0) / t_1) / t_0
          else if (fmax(x, y) <= 4.2d+107) then
              tmp = (fmax(x, y) / (t_1 * (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 t_1 = t_0 - -1.0;
      	double tmp;
      	if (fmax(x, y) <= 5.2e-179) {
      		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
      	} else if (fmax(x, y) <= 4.2e+107) {
      		tmp = (fmax(x, y) / (t_1 * (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)
      	t_1 = t_0 - -1.0
      	tmp = 0
      	if fmax(x, y) <= 5.2e-179:
      		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0
      	elif fmax(x, y) <= 4.2e+107:
      		tmp = (fmax(x, y) / (t_1 * (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))
      	t_1 = Float64(t_0 - -1.0)
      	tmp = 0.0
      	if (fmax(x, y) <= 5.2e-179)
      		tmp = Float64(Float64(Float64(fmax(x, y) * 1.0) / t_1) / t_0);
      	elseif (fmax(x, y) <= 4.2e+107)
      		tmp = Float64(Float64(fmax(x, y) / Float64(t_1 * 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);
      	t_1 = t_0 - -1.0;
      	tmp = 0.0;
      	if (max(x, y) <= 5.2e-179)
      		tmp = ((max(x, y) * 1.0) / t_1) / t_0;
      	elseif (max(x, y) <= 4.2e+107)
      		tmp = (max(x, y) / (t_1 * (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]}, Block[{t$95$1 = N[(t$95$0 - -1.0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 5.2e-179], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 4.2e+107], N[(N[(N[Max[x, y], $MachinePrecision] / N[(t$95$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.0 + 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)\\
      t_1 := t\_0 - -1\\
      \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 5.2 \cdot 10^{-179}:\\
      \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\
      
      \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 4.2 \cdot 10^{+107}:\\
      \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{t\_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 < 5.2000000000000001e-179

        1. Initial program 69.3%

          \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
        2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

          if 5.2000000000000001e-179 < y < 4.1999999999999999e107

          1. Initial program 69.3%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. 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. associate-/l*N/A

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

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

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

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

          if 4.1999999999999999e107 < y

          1. Initial program 69.3%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

        Alternative 10: 90.7% accurate, 0.0× speedup?

        \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ t_1 := t\_0 - -1\\ \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.4 \cdot 10^{-178}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\ \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 1.18 \cdot 10^{+86}:\\ \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{t\_1 \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))) (t_1 (- t_0 -1.0)))
          (if (<= (fmax x y) 1.4e-178)
            (/ (/ (* (fmax x y) 1.0) t_1) t_0)
            (if (<= (fmax x y) 1.18e+86)
              (* (/ (fmin x y) (* t_1 (* t_0 t_0))) (fmax x y))
              (/ (/ (fmin x y) (+ 1.0 (fmax x y))) t_0)))))
        double code(double x, double y) {
        	double t_0 = fmax(x, y) + fmin(x, y);
        	double t_1 = t_0 - -1.0;
        	double tmp;
        	if (fmax(x, y) <= 1.4e-178) {
        		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
        	} else if (fmax(x, y) <= 1.18e+86) {
        		tmp = (fmin(x, y) / (t_1 * (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) :: t_1
            real(8) :: tmp
            t_0 = fmax(x, y) + fmin(x, y)
            t_1 = t_0 - (-1.0d0)
            if (fmax(x, y) <= 1.4d-178) then
                tmp = ((fmax(x, y) * 1.0d0) / t_1) / t_0
            else if (fmax(x, y) <= 1.18d+86) then
                tmp = (fmin(x, y) / (t_1 * (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 t_1 = t_0 - -1.0;
        	double tmp;
        	if (fmax(x, y) <= 1.4e-178) {
        		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0;
        	} else if (fmax(x, y) <= 1.18e+86) {
        		tmp = (fmin(x, y) / (t_1 * (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)
        	t_1 = t_0 - -1.0
        	tmp = 0
        	if fmax(x, y) <= 1.4e-178:
        		tmp = ((fmax(x, y) * 1.0) / t_1) / t_0
        	elif fmax(x, y) <= 1.18e+86:
        		tmp = (fmin(x, y) / (t_1 * (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))
        	t_1 = Float64(t_0 - -1.0)
        	tmp = 0.0
        	if (fmax(x, y) <= 1.4e-178)
        		tmp = Float64(Float64(Float64(fmax(x, y) * 1.0) / t_1) / t_0);
        	elseif (fmax(x, y) <= 1.18e+86)
        		tmp = Float64(Float64(fmin(x, y) / Float64(t_1 * 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);
        	t_1 = t_0 - -1.0;
        	tmp = 0.0;
        	if (max(x, y) <= 1.4e-178)
        		tmp = ((max(x, y) * 1.0) / t_1) / t_0;
        	elseif (max(x, y) <= 1.18e+86)
        		tmp = (min(x, y) / (t_1 * (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]}, Block[{t$95$1 = N[(t$95$0 - -1.0), $MachinePrecision]}, If[LessEqual[N[Max[x, y], $MachinePrecision], 1.4e-178], N[(N[(N[(N[Max[x, y], $MachinePrecision] * 1.0), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Max[x, y], $MachinePrecision], 1.18e+86], N[(N[(N[Min[x, y], $MachinePrecision] / N[(t$95$1 * 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.0 + 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)\\
        t_1 := t\_0 - -1\\
        \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 1.4 \cdot 10^{-178}:\\
        \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right) \cdot 1}{t\_1}}{t\_0}\\
        
        \mathbf{elif}\;\mathsf{max}\left(x, y\right) \leq 1.18 \cdot 10^{+86}:\\
        \;\;\;\;\frac{\mathsf{min}\left(x, y\right)}{t\_1 \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.4000000000000001e-178

          1. Initial program 69.3%

            \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
          2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

            if 1.4000000000000001e-178 < y < 1.1799999999999999e86

            1. Initial program 69.3%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. 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 rewrites82.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 1.1799999999999999e86 < y

            1. Initial program 69.3%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

          Alternative 11: 86.4% accurate, 0.1× speedup?

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

            1. Initial program 69.3%

              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
            2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -1.4000000000000001e159 < x < -1.85e-215

              1. Initial program 69.3%

                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
              2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

                if -1.85e-215 < x

                1. Initial program 69.3%

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. 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-+.f6449.1%

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

                  \[\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. associate-/r*N/A

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

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

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

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

                    \[\leadsto \frac{\frac{x}{y}}{y + \color{blue}{1}} \]
                  8. add-flipN/A

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

                    \[\leadsto \frac{\frac{x}{y}}{y - -1} \]
                  10. lower--.f6450.5%

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

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

              Alternative 12: 86.4% accurate, 0.1× speedup?

              \[\begin{array}{l} t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\ \mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.9 \cdot 10^{+157}:\\ \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\ \mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -1.85 \cdot 10^{-215}:\\ \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) - -1}\\ \end{array} \]
              (FPCore (x y)
                :precision binary64
                (let* ((t_0 (+ (fmax x y) (fmin x y))))
                (if (<= (fmin x y) -1.9e+157)
                  (/ (/ (fmax x y) (fmin x y)) t_0)
                  (if (<= (fmin x y) -1.85e-215)
                    (* (/ (fmax x y) (* (- t_0 -1.0) t_0)) 1.0)
                    (/ (/ (fmin x y) (fmax x y)) (- (fmax x y) -1.0))))))
              double code(double x, double y) {
              	double t_0 = fmax(x, y) + fmin(x, y);
              	double tmp;
              	if (fmin(x, y) <= -1.9e+157) {
              		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
              	} else if (fmin(x, y) <= -1.85e-215) {
              		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
              	} else {
              		tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.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 (fmin(x, y) <= (-1.9d+157)) then
                      tmp = (fmax(x, y) / fmin(x, y)) / t_0
                  else if (fmin(x, y) <= (-1.85d-215)) then
                      tmp = (fmax(x, y) / ((t_0 - (-1.0d0)) * t_0)) * 1.0d0
                  else
                      tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - (-1.0d0))
                  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 (fmin(x, y) <= -1.9e+157) {
              		tmp = (fmax(x, y) / fmin(x, y)) / t_0;
              	} else if (fmin(x, y) <= -1.85e-215) {
              		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
              	} else {
              		tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0);
              	}
              	return tmp;
              }
              
              def code(x, y):
              	t_0 = fmax(x, y) + fmin(x, y)
              	tmp = 0
              	if fmin(x, y) <= -1.9e+157:
              		tmp = (fmax(x, y) / fmin(x, y)) / t_0
              	elif fmin(x, y) <= -1.85e-215:
              		tmp = (fmax(x, y) / ((t_0 - -1.0) * t_0)) * 1.0
              	else:
              		tmp = (fmin(x, y) / fmax(x, y)) / (fmax(x, y) - -1.0)
              	return tmp
              
              function code(x, y)
              	t_0 = Float64(fmax(x, y) + fmin(x, y))
              	tmp = 0.0
              	if (fmin(x, y) <= -1.9e+157)
              		tmp = Float64(Float64(fmax(x, y) / fmin(x, y)) / t_0);
              	elseif (fmin(x, y) <= -1.85e-215)
              		tmp = Float64(Float64(fmax(x, y) / Float64(Float64(t_0 - -1.0) * t_0)) * 1.0);
              	else
              		tmp = Float64(Float64(fmin(x, y) / fmax(x, y)) / Float64(fmax(x, y) - -1.0));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y)
              	t_0 = max(x, y) + min(x, y);
              	tmp = 0.0;
              	if (min(x, y) <= -1.9e+157)
              		tmp = (max(x, y) / min(x, y)) / t_0;
              	elseif (min(x, y) <= -1.85e-215)
              		tmp = (max(x, y) / ((t_0 - -1.0) * t_0)) * 1.0;
              	else
              		tmp = (min(x, y) / max(x, y)) / (max(x, y) - -1.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[Min[x, y], $MachinePrecision], -1.9e+157], N[(N[(N[Max[x, y], $MachinePrecision] / N[Min[x, y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[Min[x, y], $MachinePrecision], -1.85e-215], N[(N[(N[Max[x, y], $MachinePrecision] / N[(N[(t$95$0 - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[Max[x, y], $MachinePrecision]), $MachinePrecision] / N[(N[Max[x, y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              t_0 := \mathsf{max}\left(x, y\right) + \mathsf{min}\left(x, y\right)\\
              \mathbf{if}\;\mathsf{min}\left(x, y\right) \leq -1.9 \cdot 10^{+157}:\\
              \;\;\;\;\frac{\frac{\mathsf{max}\left(x, y\right)}{\mathsf{min}\left(x, y\right)}}{t\_0}\\
              
              \mathbf{elif}\;\mathsf{min}\left(x, y\right) \leq -1.85 \cdot 10^{-215}:\\
              \;\;\;\;\frac{\mathsf{max}\left(x, y\right)}{\left(t\_0 - -1\right) \cdot t\_0} \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\frac{\mathsf{min}\left(x, y\right)}{\mathsf{max}\left(x, y\right)}}{\mathsf{max}\left(x, y\right) - -1}\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if x < -1.9e157

                1. Initial program 69.3%

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

                if -1.9e157 < x < -1.85e-215

                1. Initial program 69.3%

                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

                  if -1.85e-215 < x

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

                    \[\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. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y}}{y + \color{blue}{1}} \]
                    8. add-flipN/A

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

                      \[\leadsto \frac{\frac{x}{y}}{y - -1} \]
                    10. lower--.f6450.5%

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

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

                Alternative 13: 81.7% 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 1.7 \cdot 10^{-49}:\\ \;\;\;\;\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) 1.7e-49)
                    (/ (/ (fmax x y) (+ 1.0 (fmin x y))) t_0)
                    (/ (/ (fmin x y) (+ 1.0 (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.7e-49) {
                		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) <= 1.7d-49) 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) <= 1.7e-49) {
                		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) <= 1.7e-49:
                		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) <= 1.7e-49)
                		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) <= 1.7e-49)
                		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], 1.7e-49], N[(N[(N[Max[x, y], $MachinePrecision] / N[(1.0 + N[Min[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Min[x, y], $MachinePrecision] / N[(1.0 + 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 1.7 \cdot 10^{-49}:\\
                \;\;\;\;\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 < 1.7e-49

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

                  if 1.7e-49 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

                Alternative 14: 81.6% accurate, 0.1× speedup?

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

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{y}{x}}{x - -1} \]
                    8. associate-/l/N/A

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

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

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

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

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

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

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

                  if 1.7e-49 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

                    \[\leadsto \color{blue}{\frac{\frac{y \cdot \frac{x}{y + x}}{\left(y + x\right) - -1}}{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-+.f6451.0%

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

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

                Alternative 15: 81.5% accurate, 0.1× speedup?

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

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{y}{x}}{x - -1} \]
                    8. associate-/l/N/A

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

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

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

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

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

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

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

                  if 1.7e-49 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

                    \[\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. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y}}{y + \color{blue}{1}} \]
                    8. add-flipN/A

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

                      \[\leadsto \frac{\frac{x}{y}}{y - -1} \]
                    10. lower--.f6450.5%

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

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

                Alternative 16: 80.2% accurate, 0.1× speedup?

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

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.0%

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

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

                  if 1.7e-49 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

                    \[\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. associate-/r*N/A

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y}}{y + \color{blue}{1}} \]
                    8. add-flipN/A

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

                      \[\leadsto \frac{\frac{x}{y}}{y - -1} \]
                    10. lower--.f6450.5%

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

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

                Alternative 17: 78.3% accurate, 0.1× speedup?

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

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.0%

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

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

                  if 1.7e-49 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

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

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

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

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

                      \[\leadsto \frac{x}{y \cdot y + \color{blue}{1 \cdot y}} \]
                    5. *-lft-identityN/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    6. lower-*.f32N/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    7. lower-unsound-*.f32N/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    8. lower-+.f64N/A

                      \[\leadsto \frac{x}{y \cdot y + \color{blue}{y}} \]
                    9. lower-unsound-*.f6449.1%

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                  6. Applied rewrites49.1%

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

                Alternative 18: 66.0% accurate, 0.1× speedup?

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

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{y}{x} \]
                  9. Applied rewrites26.6%

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

                  if 7.5000000000000004e-115 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

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

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

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

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

                      \[\leadsto \frac{x}{y \cdot y + \color{blue}{1 \cdot y}} \]
                    5. *-lft-identityN/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    6. lower-*.f32N/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    7. lower-unsound-*.f32N/A

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                    8. lower-+.f64N/A

                      \[\leadsto \frac{x}{y \cdot y + \color{blue}{y}} \]
                    9. lower-unsound-*.f6449.1%

                      \[\leadsto \frac{x}{y \cdot y + y} \]
                  6. Applied rewrites49.1%

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

                Alternative 19: 66.0% accurate, 0.1× speedup?

                \[\begin{array}{l} \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.5 \cdot 10^{-115}:\\ \;\;\;\;\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) 7.5e-115)
                  (/ (fmax x y) (fmin x y))
                  (/ (fmin x y) (* (fmax x y) (+ 1.0 (fmax x y))))))
                double code(double x, double y) {
                	double tmp;
                	if (fmax(x, y) <= 7.5e-115) {
                		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) <= 7.5d-115) 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) <= 7.5e-115) {
                		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) <= 7.5e-115:
                		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) <= 7.5e-115)
                		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) <= 7.5e-115)
                		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], 7.5e-115], 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.0 + N[Max[x, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                \mathbf{if}\;\mathsf{max}\left(x, y\right) \leq 7.5 \cdot 10^{-115}:\\
                \;\;\;\;\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 < 7.5000000000000004e-115

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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{x \cdot y}{\color{blue}{\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. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{y}{x} \]
                  9. Applied rewrites26.6%

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

                  if 7.5000000000000004e-115 < y

                  1. Initial program 69.3%

                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                  2. 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-+.f6449.1%

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

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

                Alternative 20: 26.8% 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.3%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{y}{x} \]
                9. Applied rewrites26.6%

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

                Reproduce

                ?
                herbie shell --seed 2025258 
                (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.0))))