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

Percentage Accurate: 69.1% → 99.8%
Time: 3.8s
Alternatives: 19
Speedup: 1.7×

Specification

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

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

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

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

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 19 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 69.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = ((x / (y + x)) * (y / ((1.0d0 + x) + y))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
	return ((x / (y + x)) * (y / ((1.0 + x) + y))) / (y + x);
}
[x, y] = sort([x, y])
def code(x, y):
	return ((x / (y + x)) * (y / ((1.0 + x) + y))) / (y + x)
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(Float64(x / Float64(y + x)) * Float64(y / Float64(Float64(1.0 + x) + y))) / Float64(y + x))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = ((x / (y + x)) * (y / ((1.0 + x) + y))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(1.0 + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}
\end{array}
Derivation
  1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

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

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

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (x / (y + x)) * ((y / ((1.0d0 + x) + y)) / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
	return (x / (y + x)) * ((y / ((1.0 + x) + y)) / (y + x));
}
[x, y] = sort([x, y])
def code(x, y):
	return (x / (y + x)) * ((y / ((1.0 + x) + y)) / (y + x))
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(Float64(1.0 + x) + y)) / Float64(y + x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = (x / (y + x)) * ((y / ((1.0 + x) + y)) / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(N[(1.0 + x), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{\left(1 + x\right) + y}}{y + x}
\end{array}
Derivation
  1. Initial program 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.00000000000000018e25 < x

      1. Initial program 71.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 98.3% accurate, 0.9× speedup?

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

      1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\color{blue}{x} + y}}{y + x} \]
      9. Step-by-step derivation
        1. Applied rewrites98.6%

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

        if -1 < x

        1. Initial program 70.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\color{blue}{1} + y}}{y + x} \]
        9. Step-by-step derivation
          1. Applied rewrites98.6%

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

        Alternative 5: 95.0% accurate, 0.9× speedup?

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

          1. Initial program 71.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{x} + 1} \]
          7. Step-by-step derivation
            1. Applied rewrites90.8%

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

            if -1.04999999999999996e-60 < x

            1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{x}{y + x} \cdot \frac{y}{\color{blue}{1} + y}}{y + x} \]
            9. Step-by-step derivation
              1. Applied rewrites99.3%

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

            Alternative 6: 92.0% accurate, 0.9× speedup?

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

              1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{x} + 1} \]
              7. Step-by-step derivation
                1. Applied rewrites90.2%

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

                if -1.69999999999999995e-228 < x

                1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 7: 91.8% accurate, 0.8× speedup?

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

                  1. Initial program 67.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -1.1499999999999999 < x < -1.3000000000000001e-164

                    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -1.3000000000000001e-164 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 8: 87.3% accurate, 0.8× speedup?

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

                    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{x}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites91.7%

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

                      if -9e13 < x < -2.8e-108

                      1. Initial program 86.7%

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

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

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

                        if -2.8e-108 < x

                        1. Initial program 65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 9: 85.7% accurate, 0.9× speedup?

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

                        1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -1.05e8 < x < -1.20000000000000005e-91

                          1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if -1.20000000000000005e-91 < x

                            1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                              9. associate-*l/N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              10. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                            7. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                            8. Taylor expanded in x around 0

                              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                            9. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                              2. lower-+.f6485.6

                                \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            10. Applied rewrites85.6%

                              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          8. Recombined 3 regimes into one program.
                          9. Add Preprocessing

                          Alternative 10: 83.4% accurate, 1.2× speedup?

                          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.26 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\ \end{array} \end{array} \]
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          (FPCore (x y)
                           :precision binary64
                           (if (<= x -1.26e+20)
                             (/ (/ y x) (+ y x))
                             (if (<= x -1.8e-71) (/ y (* (+ 1.0 x) x)) (/ (/ x (+ 1.0 y)) (+ y x)))))
                          assert(x < y);
                          double code(double x, double y) {
                          	double tmp;
                          	if (x <= -1.26e+20) {
                          		tmp = (y / x) / (y + x);
                          	} else if (x <= -1.8e-71) {
                          		tmp = y / ((1.0 + x) * x);
                          	} else {
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	}
                          	return tmp;
                          }
                          
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8) :: tmp
                              if (x <= (-1.26d+20)) then
                                  tmp = (y / x) / (y + x)
                              else if (x <= (-1.8d-71)) then
                                  tmp = y / ((1.0d0 + x) * x)
                              else
                                  tmp = (x / (1.0d0 + y)) / (y + x)
                              end if
                              code = tmp
                          end function
                          
                          assert x < y;
                          public static double code(double x, double y) {
                          	double tmp;
                          	if (x <= -1.26e+20) {
                          		tmp = (y / x) / (y + x);
                          	} else if (x <= -1.8e-71) {
                          		tmp = y / ((1.0 + x) * x);
                          	} else {
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	}
                          	return tmp;
                          }
                          
                          [x, y] = sort([x, y])
                          def code(x, y):
                          	tmp = 0
                          	if x <= -1.26e+20:
                          		tmp = (y / x) / (y + x)
                          	elif x <= -1.8e-71:
                          		tmp = y / ((1.0 + x) * x)
                          	else:
                          		tmp = (x / (1.0 + y)) / (y + x)
                          	return tmp
                          
                          x, y = sort([x, y])
                          function code(x, y)
                          	tmp = 0.0
                          	if (x <= -1.26e+20)
                          		tmp = Float64(Float64(y / x) / Float64(y + x));
                          	elseif (x <= -1.8e-71)
                          		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
                          	else
                          		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x));
                          	end
                          	return tmp
                          end
                          
                          x, y = num2cell(sort([x, y])){:}
                          function tmp_2 = code(x, y)
                          	tmp = 0.0;
                          	if (x <= -1.26e+20)
                          		tmp = (y / x) / (y + x);
                          	elseif (x <= -1.8e-71)
                          		tmp = y / ((1.0 + x) * x);
                          	else
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          code[x_, y_] := If[LessEqual[x, -1.26e+20], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.8e-71], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          [x, y] = \mathsf{sort}([x, y])\\
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -1.26 \cdot 10^{+20}:\\
                          \;\;\;\;\frac{\frac{y}{x}}{y + x}\\
                          
                          \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\
                          \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if x < -1.26e20

                            1. Initial program 66.3%

                              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            2. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              3. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              4. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                              5. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              6. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              7. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                              9. 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}} \]
                              10. lower-*.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                              11. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              12. lower-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              13. +-commutativeN/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              14. lower-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              15. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              16. lower-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              17. lower-/.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                              18. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                              19. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              20. lower-+.f6488.8

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                            3. Applied rewrites88.8%

                              \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                            4. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              2. lift-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              3. lift-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              4. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. associate-/r*N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              7. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              8. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              9. lower-/.f64N/A

                                \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              10. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              11. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              12. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              13. lift-+.f6499.8

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            5. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            6. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              2. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              3. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              4. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. lift-/.f64N/A

                                \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. lift-/.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                              7. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                              9. associate-*l/N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              10. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                            7. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                            8. Taylor expanded in x around inf

                              \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
                            9. Step-by-step derivation
                              1. lower-/.f6486.3

                                \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
                            10. Applied rewrites86.3%

                              \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]

                            if -1.26e20 < x < -1.8e-71

                            1. Initial program 90.5%

                              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            2. 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. *-commutativeN/A

                                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                              3. lower-*.f64N/A

                                \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                              4. lower-+.f6466.4

                                \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                            4. Applied rewrites66.4%

                              \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

                            if -1.8e-71 < x

                            1. Initial program 66.7%

                              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            2. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              3. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              4. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                              5. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              6. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              7. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                              9. 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}} \]
                              10. lower-*.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                              11. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              12. lower-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              13. +-commutativeN/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              14. lower-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              15. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              16. lower-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              17. lower-/.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                              18. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                              19. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              20. lower-+.f6484.3

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                            3. Applied rewrites84.3%

                              \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                            4. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              2. lift-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              3. lift-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              4. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. associate-/r*N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              7. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              8. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              9. lower-/.f64N/A

                                \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              10. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              11. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              12. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              13. lift-+.f6499.8

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            5. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            6. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              2. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              3. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              4. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. lift-/.f64N/A

                                \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. lift-/.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                              7. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                              9. associate-*l/N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              10. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                            7. Applied rewrites99.8%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                            8. Taylor expanded in x around 0

                              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                            9. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                              2. lower-+.f6483.7

                                \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            10. Applied rewrites83.7%

                              \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          3. Recombined 3 regimes into one program.
                          4. Add Preprocessing

                          Alternative 11: 83.3% accurate, 1.1× speedup?

                          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{1}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\ \end{array} \end{array} \]
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          (FPCore (x y)
                           :precision binary64
                           (if (<= x -1.2e-91)
                             (* (/ 1.0 (+ y x)) (/ y (+ (+ y x) 1.0)))
                             (/ (/ x (+ 1.0 y)) (+ y x))))
                          assert(x < y);
                          double code(double x, double y) {
                          	double tmp;
                          	if (x <= -1.2e-91) {
                          		tmp = (1.0 / (y + x)) * (y / ((y + x) + 1.0));
                          	} else {
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	}
                          	return tmp;
                          }
                          
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(x, y)
                          use fmin_fmax_functions
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8) :: tmp
                              if (x <= (-1.2d-91)) then
                                  tmp = (1.0d0 / (y + x)) * (y / ((y + x) + 1.0d0))
                              else
                                  tmp = (x / (1.0d0 + y)) / (y + x)
                              end if
                              code = tmp
                          end function
                          
                          assert x < y;
                          public static double code(double x, double y) {
                          	double tmp;
                          	if (x <= -1.2e-91) {
                          		tmp = (1.0 / (y + x)) * (y / ((y + x) + 1.0));
                          	} else {
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	}
                          	return tmp;
                          }
                          
                          [x, y] = sort([x, y])
                          def code(x, y):
                          	tmp = 0
                          	if x <= -1.2e-91:
                          		tmp = (1.0 / (y + x)) * (y / ((y + x) + 1.0))
                          	else:
                          		tmp = (x / (1.0 + y)) / (y + x)
                          	return tmp
                          
                          x, y = sort([x, y])
                          function code(x, y)
                          	tmp = 0.0
                          	if (x <= -1.2e-91)
                          		tmp = Float64(Float64(1.0 / Float64(y + x)) * Float64(y / Float64(Float64(y + x) + 1.0)));
                          	else
                          		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x));
                          	end
                          	return tmp
                          end
                          
                          x, y = num2cell(sort([x, y])){:}
                          function tmp_2 = code(x, y)
                          	tmp = 0.0;
                          	if (x <= -1.2e-91)
                          		tmp = (1.0 / (y + x)) * (y / ((y + x) + 1.0));
                          	else
                          		tmp = (x / (1.0 + y)) / (y + x);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          NOTE: x and y should be sorted in increasing order before calling this function.
                          code[x_, y_] := If[LessEqual[x, -1.2e-91], N[(N[(1.0 / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / N[(N[(y + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          [x, y] = \mathsf{sort}([x, y])\\
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;x \leq -1.2 \cdot 10^{-91}:\\
                          \;\;\;\;\frac{1}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if x < -1.20000000000000005e-91

                            1. Initial program 71.7%

                              \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            2. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              3. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                              4. lift-*.f64N/A

                                \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                              5. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              6. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              7. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                              8. lift-+.f64N/A

                                \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                              9. 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}} \]
                              10. lower-*.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                              11. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              12. lower-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              13. +-commutativeN/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              14. lower-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              15. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              16. lower-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                              17. lower-/.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                              18. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                              19. +-commutativeN/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              20. lower-+.f6491.3

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                            3. Applied rewrites91.3%

                              \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                            4. Step-by-step derivation
                              1. lift-/.f64N/A

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              2. lift-*.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              3. lift-+.f64N/A

                                \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              4. lift-+.f64N/A

                                \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. associate-/r*N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              7. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              8. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              9. lower-/.f64N/A

                                \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              10. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              11. lift-+.f64N/A

                                \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              12. +-commutativeN/A

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              13. lift-+.f6499.7

                                \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            5. Applied rewrites99.7%

                              \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            6. Taylor expanded in x around inf

                              \[\leadsto \frac{\color{blue}{1}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                            7. Step-by-step derivation
                              1. Applied rewrites81.5%

                                \[\leadsto \frac{\color{blue}{1}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]

                              if -1.20000000000000005e-91 < x

                              1. Initial program 66.1%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                4. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                                5. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                6. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                                9. 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}} \]
                                10. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                                11. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                12. lower-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                13. +-commutativeN/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                14. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                15. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                16. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                17. lower-/.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                                18. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                                19. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                20. lower-+.f6483.6

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              3. Applied rewrites83.6%

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              4. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. associate-/r*N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                7. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                9. lower-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                10. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                11. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                12. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                13. lift-+.f6499.8

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. lift-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. lift-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                                9. associate-*l/N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                                10. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              7. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                              8. Taylor expanded in x around 0

                                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                              9. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                                2. lower-+.f6485.6

                                  \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                              10. Applied rewrites85.6%

                                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                            8. Recombined 2 regimes into one program.
                            9. Add Preprocessing

                            Alternative 12: 82.9% accurate, 1.4× speedup?

                            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\ \end{array} \end{array} \]
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            (FPCore (x y)
                             :precision binary64
                             (if (<= x -1.2e-91) (/ (/ y (+ 1.0 x)) (+ y x)) (/ (/ x (+ 1.0 y)) (+ y x))))
                            assert(x < y);
                            double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1.2e-91) {
                            		tmp = (y / (1.0 + x)) / (y + x);
                            	} else {
                            		tmp = (x / (1.0 + y)) / (y + x);
                            	}
                            	return tmp;
                            }
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8) :: tmp
                                if (x <= (-1.2d-91)) then
                                    tmp = (y / (1.0d0 + x)) / (y + x)
                                else
                                    tmp = (x / (1.0d0 + y)) / (y + x)
                                end if
                                code = tmp
                            end function
                            
                            assert x < y;
                            public static double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1.2e-91) {
                            		tmp = (y / (1.0 + x)) / (y + x);
                            	} else {
                            		tmp = (x / (1.0 + y)) / (y + x);
                            	}
                            	return tmp;
                            }
                            
                            [x, y] = sort([x, y])
                            def code(x, y):
                            	tmp = 0
                            	if x <= -1.2e-91:
                            		tmp = (y / (1.0 + x)) / (y + x)
                            	else:
                            		tmp = (x / (1.0 + y)) / (y + x)
                            	return tmp
                            
                            x, y = sort([x, y])
                            function code(x, y)
                            	tmp = 0.0
                            	if (x <= -1.2e-91)
                            		tmp = Float64(Float64(y / Float64(1.0 + x)) / Float64(y + x));
                            	else
                            		tmp = Float64(Float64(x / Float64(1.0 + y)) / Float64(y + x));
                            	end
                            	return tmp
                            end
                            
                            x, y = num2cell(sort([x, y])){:}
                            function tmp_2 = code(x, y)
                            	tmp = 0.0;
                            	if (x <= -1.2e-91)
                            		tmp = (y / (1.0 + x)) / (y + x);
                            	else
                            		tmp = (x / (1.0 + y)) / (y + x);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            code[x_, y_] := If[LessEqual[x, -1.2e-91], N[(N[(y / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(1.0 + y), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            [x, y] = \mathsf{sort}([x, y])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -1.2 \cdot 10^{-91}:\\
                            \;\;\;\;\frac{\frac{y}{1 + x}}{y + x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{\frac{x}{1 + y}}{y + x}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if x < -1.20000000000000005e-91

                              1. Initial program 71.7%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                4. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                                5. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                6. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                                9. 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}} \]
                                10. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                                11. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                12. lower-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                13. +-commutativeN/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                14. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                15. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                16. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                17. lower-/.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                                18. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                                19. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                20. lower-+.f6491.3

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              3. Applied rewrites91.3%

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              4. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. associate-/r*N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                7. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                9. lower-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                10. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                11. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                12. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                13. lift-+.f6499.7

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. Applied rewrites99.7%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. lift-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. lift-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                                9. associate-*l/N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                                10. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              7. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                              8. Taylor expanded in y around 0

                                \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
                              9. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{\frac{y}{\color{blue}{1 + x}}}{y + x} \]
                                2. lift-+.f6481.3

                                  \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
                              10. Applied rewrites81.3%

                                \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]

                              if -1.20000000000000005e-91 < x

                              1. Initial program 66.1%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                4. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                                5. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                6. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                                9. 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}} \]
                                10. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                                11. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                12. lower-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                13. +-commutativeN/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                14. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                15. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                16. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                17. lower-/.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                                18. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                                19. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                20. lower-+.f6483.6

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              3. Applied rewrites83.6%

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              4. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. associate-/r*N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                7. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                9. lower-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                10. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                11. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                12. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                13. lift-+.f6499.8

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. lift-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. lift-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                                9. associate-*l/N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                                10. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              7. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                              8. Taylor expanded in x around 0

                                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                              9. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                                2. lower-+.f6485.6

                                  \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                              10. Applied rewrites85.6%

                                \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                            3. Recombined 2 regimes into one program.
                            4. Add Preprocessing

                            Alternative 13: 81.5% accurate, 1.4× speedup?

                            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.26 \cdot 10^{+20}:\\ \;\;\;\;\frac{\frac{y}{x}}{y + x}\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            (FPCore (x y)
                             :precision binary64
                             (if (<= x -1.26e+20)
                               (/ (/ y x) (+ y x))
                               (if (<= x -1.8e-71) (/ y (* (+ 1.0 x) x)) (/ x (* (+ 1.0 y) y)))))
                            assert(x < y);
                            double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1.26e+20) {
                            		tmp = (y / x) / (y + x);
                            	} else if (x <= -1.8e-71) {
                            		tmp = y / ((1.0 + x) * x);
                            	} else {
                            		tmp = x / ((1.0 + y) * y);
                            	}
                            	return tmp;
                            }
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8) :: tmp
                                if (x <= (-1.26d+20)) then
                                    tmp = (y / x) / (y + x)
                                else if (x <= (-1.8d-71)) then
                                    tmp = y / ((1.0d0 + x) * x)
                                else
                                    tmp = x / ((1.0d0 + y) * y)
                                end if
                                code = tmp
                            end function
                            
                            assert x < y;
                            public static double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1.26e+20) {
                            		tmp = (y / x) / (y + x);
                            	} else if (x <= -1.8e-71) {
                            		tmp = y / ((1.0 + x) * x);
                            	} else {
                            		tmp = x / ((1.0 + y) * y);
                            	}
                            	return tmp;
                            }
                            
                            [x, y] = sort([x, y])
                            def code(x, y):
                            	tmp = 0
                            	if x <= -1.26e+20:
                            		tmp = (y / x) / (y + x)
                            	elif x <= -1.8e-71:
                            		tmp = y / ((1.0 + x) * x)
                            	else:
                            		tmp = x / ((1.0 + y) * y)
                            	return tmp
                            
                            x, y = sort([x, y])
                            function code(x, y)
                            	tmp = 0.0
                            	if (x <= -1.26e+20)
                            		tmp = Float64(Float64(y / x) / Float64(y + x));
                            	elseif (x <= -1.8e-71)
                            		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
                            	else
                            		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
                            	end
                            	return tmp
                            end
                            
                            x, y = num2cell(sort([x, y])){:}
                            function tmp_2 = code(x, y)
                            	tmp = 0.0;
                            	if (x <= -1.26e+20)
                            		tmp = (y / x) / (y + x);
                            	elseif (x <= -1.8e-71)
                            		tmp = y / ((1.0 + x) * x);
                            	else
                            		tmp = x / ((1.0 + y) * y);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            code[x_, y_] := If[LessEqual[x, -1.26e+20], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.8e-71], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            [x, y] = \mathsf{sort}([x, y])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -1.26 \cdot 10^{+20}:\\
                            \;\;\;\;\frac{\frac{y}{x}}{y + x}\\
                            
                            \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\
                            \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if x < -1.26e20

                              1. Initial program 66.3%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                3. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                                4. lift-*.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                                5. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                6. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\color{blue}{\left(x + y\right)} + 1\right)} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(\left(x + y\right) + 1\right)}} \]
                                9. 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}} \]
                                10. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                                11. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                12. lower-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                13. +-commutativeN/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                14. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                15. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                16. lower-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(x + y\right) + 1} \]
                                17. lower-/.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \color{blue}{\frac{y}{\left(x + y\right) + 1}} \]
                                18. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(x + y\right) + 1}} \]
                                19. +-commutativeN/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                20. lower-+.f6488.8

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                              3. Applied rewrites88.8%

                                \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                              4. Step-by-step derivation
                                1. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{x}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                2. lift-*.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right) \cdot \left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\color{blue}{\left(y + x\right)} \cdot \left(y + x\right)} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{x}{\left(y + x\right) \cdot \color{blue}{\left(y + x\right)}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. associate-/r*N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                7. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{x + y}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                8. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                9. lower-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{x + y}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                10. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                11. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{x + y} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                12. +-commutativeN/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                13. lift-+.f6499.8

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              5. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                              6. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}} \]
                                2. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{\color{blue}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                3. lift-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x}}{y + x}} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                4. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{\color{blue}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                5. lift-/.f64N/A

                                  \[\leadsto \frac{\color{blue}{\frac{x}{y + x}}}{y + x} \cdot \frac{y}{\left(y + x\right) + 1} \]
                                6. lift-/.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \color{blue}{\frac{y}{\left(y + x\right) + 1}} \]
                                7. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right)} + 1} \]
                                8. lift-+.f64N/A

                                  \[\leadsto \frac{\frac{x}{y + x}}{y + x} \cdot \frac{y}{\color{blue}{\left(y + x\right) + 1}} \]
                                9. associate-*l/N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                                10. lower-/.f64N/A

                                  \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(y + x\right) + 1}}{y + x}} \]
                              7. Applied rewrites99.8%

                                \[\leadsto \color{blue}{\frac{\frac{x}{y + x} \cdot \frac{y}{\left(1 + x\right) + y}}{y + x}} \]
                              8. Taylor expanded in x around inf

                                \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]
                              9. Step-by-step derivation
                                1. lower-/.f6486.3

                                  \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{y + x} \]
                              10. Applied rewrites86.3%

                                \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{y + x} \]

                              if -1.26e20 < x < -1.8e-71

                              1. Initial program 90.5%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. 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. *-commutativeN/A

                                  \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                                4. lower-+.f6466.4

                                  \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                              4. Applied rewrites66.4%

                                \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

                              if -1.8e-71 < x

                              1. Initial program 66.7%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. 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. *-commutativeN/A

                                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                4. lower-+.f6480.8

                                  \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                              4. Applied rewrites80.8%

                                \[\leadsto \color{blue}{\frac{x}{\left(1 + y\right) \cdot y}} \]
                            3. Recombined 3 regimes into one program.
                            4. Add Preprocessing

                            Alternative 14: 81.4% accurate, 1.4× speedup?

                            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+28}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\ \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            (FPCore (x y)
                             :precision binary64
                             (if (<= x -1e+28)
                               (/ (/ y x) x)
                               (if (<= x -1.8e-71) (/ y (* (+ 1.0 x) x)) (/ x (* (+ 1.0 y) y)))))
                            assert(x < y);
                            double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1e+28) {
                            		tmp = (y / x) / x;
                            	} else if (x <= -1.8e-71) {
                            		tmp = y / ((1.0 + x) * x);
                            	} else {
                            		tmp = x / ((1.0 + y) * y);
                            	}
                            	return tmp;
                            }
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(x, y)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8) :: tmp
                                if (x <= (-1d+28)) then
                                    tmp = (y / x) / x
                                else if (x <= (-1.8d-71)) then
                                    tmp = y / ((1.0d0 + x) * x)
                                else
                                    tmp = x / ((1.0d0 + y) * y)
                                end if
                                code = tmp
                            end function
                            
                            assert x < y;
                            public static double code(double x, double y) {
                            	double tmp;
                            	if (x <= -1e+28) {
                            		tmp = (y / x) / x;
                            	} else if (x <= -1.8e-71) {
                            		tmp = y / ((1.0 + x) * x);
                            	} else {
                            		tmp = x / ((1.0 + y) * y);
                            	}
                            	return tmp;
                            }
                            
                            [x, y] = sort([x, y])
                            def code(x, y):
                            	tmp = 0
                            	if x <= -1e+28:
                            		tmp = (y / x) / x
                            	elif x <= -1.8e-71:
                            		tmp = y / ((1.0 + x) * x)
                            	else:
                            		tmp = x / ((1.0 + y) * y)
                            	return tmp
                            
                            x, y = sort([x, y])
                            function code(x, y)
                            	tmp = 0.0
                            	if (x <= -1e+28)
                            		tmp = Float64(Float64(y / x) / x);
                            	elseif (x <= -1.8e-71)
                            		tmp = Float64(y / Float64(Float64(1.0 + x) * x));
                            	else
                            		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
                            	end
                            	return tmp
                            end
                            
                            x, y = num2cell(sort([x, y])){:}
                            function tmp_2 = code(x, y)
                            	tmp = 0.0;
                            	if (x <= -1e+28)
                            		tmp = (y / x) / x;
                            	elseif (x <= -1.8e-71)
                            		tmp = y / ((1.0 + x) * x);
                            	else
                            		tmp = x / ((1.0 + y) * y);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: x and y should be sorted in increasing order before calling this function.
                            code[x_, y_] := If[LessEqual[x, -1e+28], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.8e-71], N[(y / N[(N[(1.0 + x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            [x, y] = \mathsf{sort}([x, y])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -1 \cdot 10^{+28}:\\
                            \;\;\;\;\frac{\frac{y}{x}}{x}\\
                            
                            \mathbf{elif}\;x \leq -1.8 \cdot 10^{-71}:\\
                            \;\;\;\;\frac{y}{\left(1 + x\right) \cdot x}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if x < -9.99999999999999958e27

                              1. Initial program 65.8%

                                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                              2. Taylor expanded in x around inf

                                \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{{x}^{2}}} \]
                              3. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{\color{blue}{{x}^{2}}} \]
                                2. +-commutativeN/A

                                  \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                3. lower-+.f64N/A

                                  \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                4. mul-1-negN/A

                                  \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right)\right) + y}{{x}^{2}} \]
                                5. lower-neg.f64N/A

                                  \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                6. lower-/.f64N/A

                                  \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                7. *-commutativeN/A

                                  \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                8. lower-*.f64N/A

                                  \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                9. +-commutativeN/A

                                  \[\leadsto \frac{\left(-\frac{\left(\left(y + 2 \cdot y\right) + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                10. distribute-rgt1-inN/A

                                  \[\leadsto \frac{\left(-\frac{\left(\left(2 + 1\right) \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                11. metadata-evalN/A

                                  \[\leadsto \frac{\left(-\frac{\left(3 \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                12. lower-fma.f64N/A

                                  \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                13. unpow2N/A

                                  \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                                14. lower-*.f6475.9

                                  \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                              4. Applied rewrites75.9%

                                \[\leadsto \color{blue}{\frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot x}} \]
                              5. Taylor expanded in x around inf

                                \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                              6. Step-by-step derivation
                                1. Applied rewrites81.6%

                                  \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                                2. Step-by-step derivation
                                  1. lift-/.f64N/A

                                    \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
                                  2. lift-*.f64N/A

                                    \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                  3. associate-/r*N/A

                                    \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                  4. lower-/.f64N/A

                                    \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                  5. lower-/.f6486.4

                                    \[\leadsto \frac{\frac{y}{x}}{x} \]
                                3. Applied rewrites86.4%

                                  \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]

                                if -9.99999999999999958e27 < x < -1.8e-71

                                1. Initial program 90.5%

                                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. 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. *-commutativeN/A

                                    \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                                  3. lower-*.f64N/A

                                    \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                                  4. lower-+.f6466.5

                                    \[\leadsto \frac{y}{\left(1 + x\right) \cdot x} \]
                                4. Applied rewrites66.5%

                                  \[\leadsto \color{blue}{\frac{y}{\left(1 + x\right) \cdot x}} \]

                                if -1.8e-71 < x

                                1. Initial program 66.7%

                                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. 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. *-commutativeN/A

                                    \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                  3. lower-*.f64N/A

                                    \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                  4. lower-+.f6480.8

                                    \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                                4. Applied rewrites80.8%

                                  \[\leadsto \color{blue}{\frac{x}{\left(1 + y\right) \cdot y}} \]
                              7. Recombined 3 regimes into one program.
                              8. Add Preprocessing

                              Alternative 15: 78.7% accurate, 1.7× speedup?

                              \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.15:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\ \end{array} \end{array} \]
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              (FPCore (x y)
                               :precision binary64
                               (if (<= x -1.15) (/ (/ y x) x) (/ x (* (+ 1.0 y) y))))
                              assert(x < y);
                              double code(double x, double y) {
                              	double tmp;
                              	if (x <= -1.15) {
                              		tmp = (y / x) / x;
                              	} else {
                              		tmp = x / ((1.0 + y) * y);
                              	}
                              	return tmp;
                              }
                              
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8) :: tmp
                                  if (x <= (-1.15d0)) then
                                      tmp = (y / x) / x
                                  else
                                      tmp = x / ((1.0d0 + y) * y)
                                  end if
                                  code = tmp
                              end function
                              
                              assert x < y;
                              public static double code(double x, double y) {
                              	double tmp;
                              	if (x <= -1.15) {
                              		tmp = (y / x) / x;
                              	} else {
                              		tmp = x / ((1.0 + y) * y);
                              	}
                              	return tmp;
                              }
                              
                              [x, y] = sort([x, y])
                              def code(x, y):
                              	tmp = 0
                              	if x <= -1.15:
                              		tmp = (y / x) / x
                              	else:
                              		tmp = x / ((1.0 + y) * y)
                              	return tmp
                              
                              x, y = sort([x, y])
                              function code(x, y)
                              	tmp = 0.0
                              	if (x <= -1.15)
                              		tmp = Float64(Float64(y / x) / x);
                              	else
                              		tmp = Float64(x / Float64(Float64(1.0 + y) * y));
                              	end
                              	return tmp
                              end
                              
                              x, y = num2cell(sort([x, y])){:}
                              function tmp_2 = code(x, y)
                              	tmp = 0.0;
                              	if (x <= -1.15)
                              		tmp = (y / x) / x;
                              	else
                              		tmp = x / ((1.0 + y) * y);
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              NOTE: x and y should be sorted in increasing order before calling this function.
                              code[x_, y_] := If[LessEqual[x, -1.15], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(x / N[(N[(1.0 + y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              [x, y] = \mathsf{sort}([x, y])\\
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;x \leq -1.15:\\
                              \;\;\;\;\frac{\frac{y}{x}}{x}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{x}{\left(1 + y\right) \cdot y}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if x < -1.1499999999999999

                                1. Initial program 67.9%

                                  \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                2. Taylor expanded in x around inf

                                  \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{{x}^{2}}} \]
                                3. Step-by-step derivation
                                  1. lower-/.f64N/A

                                    \[\leadsto \frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{\color{blue}{{x}^{2}}} \]
                                  2. +-commutativeN/A

                                    \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                  3. lower-+.f64N/A

                                    \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                  4. mul-1-negN/A

                                    \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right)\right) + y}{{x}^{2}} \]
                                  5. lower-neg.f64N/A

                                    \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                  6. lower-/.f64N/A

                                    \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                  7. *-commutativeN/A

                                    \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  8. lower-*.f64N/A

                                    \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  9. +-commutativeN/A

                                    \[\leadsto \frac{\left(-\frac{\left(\left(y + 2 \cdot y\right) + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  10. distribute-rgt1-inN/A

                                    \[\leadsto \frac{\left(-\frac{\left(\left(2 + 1\right) \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  11. metadata-evalN/A

                                    \[\leadsto \frac{\left(-\frac{\left(3 \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  12. lower-fma.f64N/A

                                    \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                  13. unpow2N/A

                                    \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                                  14. lower-*.f6475.1

                                    \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                                4. Applied rewrites75.1%

                                  \[\leadsto \color{blue}{\frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot x}} \]
                                5. Taylor expanded in x around inf

                                  \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites79.8%

                                    \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                                  2. Step-by-step derivation
                                    1. lift-/.f64N/A

                                      \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
                                    2. lift-*.f64N/A

                                      \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                    3. associate-/r*N/A

                                      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                    4. lower-/.f64N/A

                                      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                    5. lower-/.f6484.2

                                      \[\leadsto \frac{\frac{y}{x}}{x} \]
                                  3. Applied rewrites84.2%

                                    \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]

                                  if -1.1499999999999999 < x

                                  1. Initial program 70.1%

                                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                  2. Taylor expanded in x around 0

                                    \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                                    2. *-commutativeN/A

                                      \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                    3. lower-*.f64N/A

                                      \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                                    4. lower-+.f6474.4

                                      \[\leadsto \frac{x}{\left(1 + y\right) \cdot y} \]
                                  4. Applied rewrites74.4%

                                    \[\leadsto \color{blue}{\frac{x}{\left(1 + y\right) \cdot y}} \]
                                7. Recombined 2 regimes into one program.
                                8. Add Preprocessing

                                Alternative 16: 67.2% accurate, 2.1× speedup?

                                \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-12}:\\ \;\;\;\;\frac{\frac{y}{x}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
                                NOTE: x and y should be sorted in increasing order before calling this function.
                                (FPCore (x y)
                                 :precision binary64
                                 (if (<= x -4.6e-12) (/ (/ y x) x) (/ (/ x y) y)))
                                assert(x < y);
                                double code(double x, double y) {
                                	double tmp;
                                	if (x <= -4.6e-12) {
                                		tmp = (y / x) / x;
                                	} else {
                                		tmp = (x / y) / y;
                                	}
                                	return tmp;
                                }
                                
                                NOTE: x and y should be sorted in increasing order before calling this function.
                                module fmin_fmax_functions
                                    implicit none
                                    private
                                    public fmax
                                    public fmin
                                
                                    interface fmax
                                        module procedure fmax88
                                        module procedure fmax44
                                        module procedure fmax84
                                        module procedure fmax48
                                    end interface
                                    interface fmin
                                        module procedure fmin88
                                        module procedure fmin44
                                        module procedure fmin84
                                        module procedure fmin48
                                    end interface
                                contains
                                    real(8) function fmax88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmax44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmax84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmax48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin88(x, y) result (res)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(4) function fmin44(x, y) result (res)
                                        real(4), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                    end function
                                    real(8) function fmin84(x, y) result(res)
                                        real(8), intent (in) :: x
                                        real(4), intent (in) :: y
                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                    end function
                                    real(8) function fmin48(x, y) result(res)
                                        real(4), intent (in) :: x
                                        real(8), intent (in) :: y
                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                    end function
                                end module
                                
                                real(8) function code(x, y)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8) :: tmp
                                    if (x <= (-4.6d-12)) then
                                        tmp = (y / x) / x
                                    else
                                        tmp = (x / y) / y
                                    end if
                                    code = tmp
                                end function
                                
                                assert x < y;
                                public static double code(double x, double y) {
                                	double tmp;
                                	if (x <= -4.6e-12) {
                                		tmp = (y / x) / x;
                                	} else {
                                		tmp = (x / y) / y;
                                	}
                                	return tmp;
                                }
                                
                                [x, y] = sort([x, y])
                                def code(x, y):
                                	tmp = 0
                                	if x <= -4.6e-12:
                                		tmp = (y / x) / x
                                	else:
                                		tmp = (x / y) / y
                                	return tmp
                                
                                x, y = sort([x, y])
                                function code(x, y)
                                	tmp = 0.0
                                	if (x <= -4.6e-12)
                                		tmp = Float64(Float64(y / x) / x);
                                	else
                                		tmp = Float64(Float64(x / y) / y);
                                	end
                                	return tmp
                                end
                                
                                x, y = num2cell(sort([x, y])){:}
                                function tmp_2 = code(x, y)
                                	tmp = 0.0;
                                	if (x <= -4.6e-12)
                                		tmp = (y / x) / x;
                                	else
                                		tmp = (x / y) / y;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                NOTE: x and y should be sorted in increasing order before calling this function.
                                code[x_, y_] := If[LessEqual[x, -4.6e-12], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
                                
                                \begin{array}{l}
                                [x, y] = \mathsf{sort}([x, y])\\
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;x \leq -4.6 \cdot 10^{-12}:\\
                                \;\;\;\;\frac{\frac{y}{x}}{x}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{\frac{x}{y}}{y}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if x < -4.59999999999999979e-12

                                  1. Initial program 68.6%

                                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                  2. Taylor expanded in x around inf

                                    \[\leadsto \color{blue}{\frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{{x}^{2}}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{y + -1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}}{\color{blue}{{x}^{2}}} \]
                                    2. +-commutativeN/A

                                      \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                    3. lower-+.f64N/A

                                      \[\leadsto \frac{-1 \cdot \frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x} + y}{{\color{blue}{x}}^{2}} \]
                                    4. mul-1-negN/A

                                      \[\leadsto \frac{\left(\mathsf{neg}\left(\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right)\right) + y}{{x}^{2}} \]
                                    5. lower-neg.f64N/A

                                      \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                    6. lower-/.f64N/A

                                      \[\leadsto \frac{\left(-\frac{y \cdot \left(1 + \left(y + 2 \cdot y\right)\right)}{x}\right) + y}{{x}^{2}} \]
                                    7. *-commutativeN/A

                                      \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    8. lower-*.f64N/A

                                      \[\leadsto \frac{\left(-\frac{\left(1 + \left(y + 2 \cdot y\right)\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    9. +-commutativeN/A

                                      \[\leadsto \frac{\left(-\frac{\left(\left(y + 2 \cdot y\right) + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    10. distribute-rgt1-inN/A

                                      \[\leadsto \frac{\left(-\frac{\left(\left(2 + 1\right) \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    11. metadata-evalN/A

                                      \[\leadsto \frac{\left(-\frac{\left(3 \cdot y + 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    12. lower-fma.f64N/A

                                      \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{{x}^{2}} \]
                                    13. unpow2N/A

                                      \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                                    14. lower-*.f6473.2

                                      \[\leadsto \frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot \color{blue}{x}} \]
                                  4. Applied rewrites73.2%

                                    \[\leadsto \color{blue}{\frac{\left(-\frac{\mathsf{fma}\left(3, y, 1\right) \cdot y}{x}\right) + y}{x \cdot x}} \]
                                  5. Taylor expanded in x around inf

                                    \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites77.8%

                                      \[\leadsto \frac{y}{\color{blue}{x} \cdot x} \]
                                    2. Step-by-step derivation
                                      1. lift-/.f64N/A

                                        \[\leadsto \frac{y}{\color{blue}{x \cdot x}} \]
                                      2. lift-*.f64N/A

                                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                      3. associate-/r*N/A

                                        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                      4. lower-/.f64N/A

                                        \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]
                                      5. lower-/.f6482.1

                                        \[\leadsto \frac{\frac{y}{x}}{x} \]
                                    3. Applied rewrites82.1%

                                      \[\leadsto \frac{\frac{y}{x}}{\color{blue}{x}} \]

                                    if -4.59999999999999979e-12 < x

                                    1. Initial program 69.6%

                                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                    2. Taylor expanded in y around inf

                                      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                                      2. unpow2N/A

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                      3. lower-*.f6452.3

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                    4. Applied rewrites52.3%

                                      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
                                    5. Step-by-step derivation
                                      1. lift-*.f64N/A

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                      2. lift-/.f64N/A

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
                                      3. associate-/r*N/A

                                        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                      4. lower-/.f64N/A

                                        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                      5. lower-/.f6455.0

                                        \[\leadsto \frac{\frac{x}{y}}{y} \]
                                    6. Applied rewrites55.0%

                                      \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                  7. Recombined 2 regimes into one program.
                                  8. Add Preprocessing

                                  Alternative 17: 65.1% accurate, 2.1× speedup?

                                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 7 \cdot 10^{+26}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{y}\\ \end{array} \end{array} \]
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  (FPCore (x y)
                                   :precision binary64
                                   (if (<= y 7e+26) (/ y (* x x)) (/ (/ x y) y)))
                                  assert(x < y);
                                  double code(double x, double y) {
                                  	double tmp;
                                  	if (y <= 7e+26) {
                                  		tmp = y / (x * x);
                                  	} else {
                                  		tmp = (x / y) / y;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8) :: tmp
                                      if (y <= 7d+26) then
                                          tmp = y / (x * x)
                                      else
                                          tmp = (x / y) / y
                                      end if
                                      code = tmp
                                  end function
                                  
                                  assert x < y;
                                  public static double code(double x, double y) {
                                  	double tmp;
                                  	if (y <= 7e+26) {
                                  		tmp = y / (x * x);
                                  	} else {
                                  		tmp = (x / y) / y;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  [x, y] = sort([x, y])
                                  def code(x, y):
                                  	tmp = 0
                                  	if y <= 7e+26:
                                  		tmp = y / (x * x)
                                  	else:
                                  		tmp = (x / y) / y
                                  	return tmp
                                  
                                  x, y = sort([x, y])
                                  function code(x, y)
                                  	tmp = 0.0
                                  	if (y <= 7e+26)
                                  		tmp = Float64(y / Float64(x * x));
                                  	else
                                  		tmp = Float64(Float64(x / y) / y);
                                  	end
                                  	return tmp
                                  end
                                  
                                  x, y = num2cell(sort([x, y])){:}
                                  function tmp_2 = code(x, y)
                                  	tmp = 0.0;
                                  	if (y <= 7e+26)
                                  		tmp = y / (x * x);
                                  	else
                                  		tmp = (x / y) / y;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  code[x_, y_] := If[LessEqual[y, 7e+26], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  [x, y] = \mathsf{sort}([x, y])\\
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;y \leq 7 \cdot 10^{+26}:\\
                                  \;\;\;\;\frac{y}{x \cdot x}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{\frac{x}{y}}{y}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if y < 6.9999999999999998e26

                                    1. Initial program 70.8%

                                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
                                      2. unpow2N/A

                                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                      3. lower-*.f6451.3

                                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                    4. Applied rewrites51.3%

                                      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

                                    if 6.9999999999999998e26 < y

                                    1. Initial program 66.6%

                                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                    2. Taylor expanded in y around inf

                                      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                                      2. unpow2N/A

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                      3. lower-*.f6481.1

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                    4. Applied rewrites81.1%

                                      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
                                    5. Step-by-step derivation
                                      1. lift-*.f64N/A

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                      2. lift-/.f64N/A

                                        \[\leadsto \frac{x}{\color{blue}{y \cdot y}} \]
                                      3. associate-/r*N/A

                                        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                      4. lower-/.f64N/A

                                        \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                      5. lower-/.f6487.0

                                        \[\leadsto \frac{\frac{x}{y}}{y} \]
                                    6. Applied rewrites87.0%

                                      \[\leadsto \frac{\frac{x}{y}}{\color{blue}{y}} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Add Preprocessing

                                  Alternative 18: 63.8% accurate, 2.2× speedup?

                                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-12}:\\ \;\;\;\;\frac{y}{x \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot y}\\ \end{array} \end{array} \]
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  (FPCore (x y)
                                   :precision binary64
                                   (if (<= x -4.6e-12) (/ y (* x x)) (/ x (* y y))))
                                  assert(x < y);
                                  double code(double x, double y) {
                                  	double tmp;
                                  	if (x <= -4.6e-12) {
                                  		tmp = y / (x * x);
                                  	} else {
                                  		tmp = x / (y * y);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      real(8) :: tmp
                                      if (x <= (-4.6d-12)) then
                                          tmp = y / (x * x)
                                      else
                                          tmp = x / (y * y)
                                      end if
                                      code = tmp
                                  end function
                                  
                                  assert x < y;
                                  public static double code(double x, double y) {
                                  	double tmp;
                                  	if (x <= -4.6e-12) {
                                  		tmp = y / (x * x);
                                  	} else {
                                  		tmp = x / (y * y);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  [x, y] = sort([x, y])
                                  def code(x, y):
                                  	tmp = 0
                                  	if x <= -4.6e-12:
                                  		tmp = y / (x * x)
                                  	else:
                                  		tmp = x / (y * y)
                                  	return tmp
                                  
                                  x, y = sort([x, y])
                                  function code(x, y)
                                  	tmp = 0.0
                                  	if (x <= -4.6e-12)
                                  		tmp = Float64(y / Float64(x * x));
                                  	else
                                  		tmp = Float64(x / Float64(y * y));
                                  	end
                                  	return tmp
                                  end
                                  
                                  x, y = num2cell(sort([x, y])){:}
                                  function tmp_2 = code(x, y)
                                  	tmp = 0.0;
                                  	if (x <= -4.6e-12)
                                  		tmp = y / (x * x);
                                  	else
                                  		tmp = x / (y * y);
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  code[x_, y_] := If[LessEqual[x, -4.6e-12], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  [x, y] = \mathsf{sort}([x, y])\\
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;x \leq -4.6 \cdot 10^{-12}:\\
                                  \;\;\;\;\frac{y}{x \cdot x}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{x}{y \cdot y}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if x < -4.59999999999999979e-12

                                    1. Initial program 68.6%

                                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                    2. Taylor expanded in x around inf

                                      \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{y}{\color{blue}{{x}^{2}}} \]
                                      2. unpow2N/A

                                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                      3. lower-*.f6477.8

                                        \[\leadsto \frac{y}{x \cdot \color{blue}{x}} \]
                                    4. Applied rewrites77.8%

                                      \[\leadsto \color{blue}{\frac{y}{x \cdot x}} \]

                                    if -4.59999999999999979e-12 < x

                                    1. Initial program 69.6%

                                      \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                    2. Taylor expanded in y around inf

                                      \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                    3. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                                      2. unpow2N/A

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                      3. lower-*.f6452.3

                                        \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                    4. Applied rewrites52.3%

                                      \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Add Preprocessing

                                  Alternative 19: 35.8% accurate, 3.3× speedup?

                                  \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{x}{y \cdot y} \end{array} \]
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  (FPCore (x y) :precision binary64 (/ x (* y y)))
                                  assert(x < y);
                                  double code(double x, double y) {
                                  	return x / (y * y);
                                  }
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  module fmin_fmax_functions
                                      implicit none
                                      private
                                      public fmax
                                      public fmin
                                  
                                      interface fmax
                                          module procedure fmax88
                                          module procedure fmax44
                                          module procedure fmax84
                                          module procedure fmax48
                                      end interface
                                      interface fmin
                                          module procedure fmin88
                                          module procedure fmin44
                                          module procedure fmin84
                                          module procedure fmin48
                                      end interface
                                  contains
                                      real(8) function fmax88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmax44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmax84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmax48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin88(x, y) result (res)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(4) function fmin44(x, y) result (res)
                                          real(4), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                      end function
                                      real(8) function fmin84(x, y) result(res)
                                          real(8), intent (in) :: x
                                          real(4), intent (in) :: y
                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                      end function
                                      real(8) function fmin48(x, y) result(res)
                                          real(4), intent (in) :: x
                                          real(8), intent (in) :: y
                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                      end function
                                  end module
                                  
                                  real(8) function code(x, y)
                                  use fmin_fmax_functions
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      code = x / (y * y)
                                  end function
                                  
                                  assert x < y;
                                  public static double code(double x, double y) {
                                  	return x / (y * y);
                                  }
                                  
                                  [x, y] = sort([x, y])
                                  def code(x, y):
                                  	return x / (y * y)
                                  
                                  x, y = sort([x, y])
                                  function code(x, y)
                                  	return Float64(x / Float64(y * y))
                                  end
                                  
                                  x, y = num2cell(sort([x, y])){:}
                                  function tmp = code(x, y)
                                  	tmp = x / (y * y);
                                  end
                                  
                                  NOTE: x and y should be sorted in increasing order before calling this function.
                                  code[x_, y_] := N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  [x, y] = \mathsf{sort}([x, y])\\
                                  \\
                                  \frac{x}{y \cdot y}
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 69.1%

                                    \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                                  2. Taylor expanded in y around inf

                                    \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                  3. Step-by-step derivation
                                    1. lower-/.f64N/A

                                      \[\leadsto \frac{x}{\color{blue}{{y}^{2}}} \]
                                    2. unpow2N/A

                                      \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                    3. lower-*.f6435.8

                                      \[\leadsto \frac{x}{y \cdot \color{blue}{y}} \]
                                  4. Applied rewrites35.8%

                                    \[\leadsto \color{blue}{\frac{x}{y \cdot y}} \]
                                  5. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2025114 
                                  (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))))