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

Percentage Accurate: 69.6% → 99.8%
Time: 4.3s
Alternatives: 22
Speedup: 1.8×

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 22 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.6% 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{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (/ (* (/ y (- y (- -1.0 x))) (/ x (+ y x))) (+ y x)))
assert(x < y);
double code(double x, double y) {
	return ((y / (y - (-1.0 - x))) * (x / (y + x))) / (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 = ((y / (y - ((-1.0d0) - x))) * (x / (y + x))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
	return ((y / (y - (-1.0 - x))) * (x / (y + x))) / (y + x);
}
[x, y] = sort([x, y])
def code(x, y):
	return ((y / (y - (-1.0 - x))) * (x / (y + x))) / (y + x)
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(Float64(y / Float64(y - Float64(-1.0 - x))) * Float64(x / Float64(y + x))) / Float64(y + x))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = ((y / (y - (-1.0 - x))) * (x / (y + x))) / (y + x);
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(N[(y / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{y}{y - \left(-1 - x\right)}}{x + y} \cdot \frac{x}{y + x} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (* (/ (/ y (- y (- -1.0 x))) (+ x y)) (/ x (+ y x))))
assert(x < y);
double code(double x, double y) {
	return ((y / (y - (-1.0 - x))) / (x + y)) * (x / (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 = ((y / (y - ((-1.0d0) - x))) / (x + y)) * (x / (y + x))
end function
assert x < y;
public static double code(double x, double y) {
	return ((y / (y - (-1.0 - x))) / (x + y)) * (x / (y + x));
}
[x, y] = sort([x, y])
def code(x, y):
	return ((y / (y - (-1.0 - x))) / (x + y)) * (x / (y + x))
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(Float64(y / Float64(y - Float64(-1.0 - x))) / Float64(x + y)) * Float64(x / Float64(y + x)))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = ((y / (y - (-1.0 - x))) / (x + y)) * (x / (y + x));
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_] := N[(N[(N[(y / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\frac{\frac{y}{y - \left(-1 - x\right)}}{x + y} \cdot \frac{x}{y + x}
\end{array}
Derivation
  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. Step-by-step derivation
    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 97.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{y}{y - \left(-1 - x\right)}\\ \mathbf{if}\;y \leq 1.85 \cdot 10^{-16}:\\ \;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+154}:\\ \;\;\;\;\frac{t\_0 \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0}{x + y} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ y (- y (- -1.0 x)))))
   (if (<= y 1.85e-16)
     (/ (/ (* (/ x (+ x y)) y) (- x -1.0)) (+ x y))
     (if (<= y 1.42e+154)
       (/ (* t_0 x) (* (+ y x) (+ y x)))
       (* (/ t_0 (+ x y)) (/ x y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y / (y - (-1.0 - x));
	double tmp;
	if (y <= 1.85e-16) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (y <= 1.42e+154) {
		tmp = (t_0 * x) / ((y + x) * (y + x));
	} else {
		tmp = (t_0 / (x + y)) * (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 = y / (y - ((-1.0d0) - x))
    if (y <= 1.85d-16) then
        tmp = (((x / (x + y)) * y) / (x - (-1.0d0))) / (x + y)
    else if (y <= 1.42d+154) then
        tmp = (t_0 * x) / ((y + x) * (y + x))
    else
        tmp = (t_0 / (x + y)) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y / (y - (-1.0 - x));
	double tmp;
	if (y <= 1.85e-16) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (y <= 1.42e+154) {
		tmp = (t_0 * x) / ((y + x) * (y + x));
	} else {
		tmp = (t_0 / (x + y)) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y / (y - (-1.0 - x))
	tmp = 0
	if y <= 1.85e-16:
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y)
	elif y <= 1.42e+154:
		tmp = (t_0 * x) / ((y + x) * (y + x))
	else:
		tmp = (t_0 / (x + y)) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y / Float64(y - Float64(-1.0 - x)))
	tmp = 0.0
	if (y <= 1.85e-16)
		tmp = Float64(Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(x - -1.0)) / Float64(x + y));
	elseif (y <= 1.42e+154)
		tmp = Float64(Float64(t_0 * x) / Float64(Float64(y + x) * Float64(y + x)));
	else
		tmp = Float64(Float64(t_0 / Float64(x + y)) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y / (y - (-1.0 - x));
	tmp = 0.0;
	if (y <= 1.85e-16)
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	elseif (y <= 1.42e+154)
		tmp = (t_0 * x) / ((y + x) * (y + x));
	else
		tmp = (t_0 / (x + y)) * (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[(y / N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.85e-16], N[(N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+154], N[(N[(t$95$0 * x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := \frac{y}{y - \left(-1 - x\right)}\\
\mathbf{if}\;y \leq 1.85 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\

\mathbf{elif}\;y \leq 1.42 \cdot 10^{+154}:\\
\;\;\;\;\frac{t\_0 \cdot x}{\left(y + x\right) \cdot \left(y + x\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0}{x + y} \cdot \frac{x}{y}\\


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

    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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85e-16 < y < 1.42e154

    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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

    if 1.42e154 < y

    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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := y - \left(-1 - x\right)\\ \mathbf{if}\;y \leq 8 \cdot 10^{-231}:\\ \;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\ \mathbf{elif}\;y \leq 1.42 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{t\_0 \cdot \left(y + x\right)} \cdot \frac{x}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{t\_0}}{x + y} \cdot \frac{x}{y}\\ \end{array} \end{array} \]
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (- y (- -1.0 x))))
   (if (<= y 8e-231)
     (/ (/ (* (/ x (+ x y)) y) (- x -1.0)) (+ x y))
     (if (<= y 1.42e+154)
       (* (/ y (* t_0 (+ y x))) (/ x (+ y x)))
       (* (/ (/ y t_0) (+ x y)) (/ x y))))))
assert(x < y);
double code(double x, double y) {
	double t_0 = y - (-1.0 - x);
	double tmp;
	if (y <= 8e-231) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (y <= 1.42e+154) {
		tmp = (y / (t_0 * (y + x))) * (x / (y + x));
	} else {
		tmp = ((y / t_0) / (x + y)) * (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 = y - ((-1.0d0) - x)
    if (y <= 8d-231) then
        tmp = (((x / (x + y)) * y) / (x - (-1.0d0))) / (x + y)
    else if (y <= 1.42d+154) then
        tmp = (y / (t_0 * (y + x))) * (x / (y + x))
    else
        tmp = ((y / t_0) / (x + y)) * (x / y)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double t_0 = y - (-1.0 - x);
	double tmp;
	if (y <= 8e-231) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (y <= 1.42e+154) {
		tmp = (y / (t_0 * (y + x))) * (x / (y + x));
	} else {
		tmp = ((y / t_0) / (x + y)) * (x / y);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	t_0 = y - (-1.0 - x)
	tmp = 0
	if y <= 8e-231:
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y)
	elif y <= 1.42e+154:
		tmp = (y / (t_0 * (y + x))) * (x / (y + x))
	else:
		tmp = ((y / t_0) / (x + y)) * (x / y)
	return tmp
x, y = sort([x, y])
function code(x, y)
	t_0 = Float64(y - Float64(-1.0 - x))
	tmp = 0.0
	if (y <= 8e-231)
		tmp = Float64(Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(x - -1.0)) / Float64(x + y));
	elseif (y <= 1.42e+154)
		tmp = Float64(Float64(y / Float64(t_0 * Float64(y + x))) * Float64(x / Float64(y + x)));
	else
		tmp = Float64(Float64(Float64(y / t_0) / Float64(x + y)) * Float64(x / y));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	t_0 = y - (-1.0 - x);
	tmp = 0.0;
	if (y <= 8e-231)
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	elseif (y <= 1.42e+154)
		tmp = (y / (t_0 * (y + x))) * (x / (y + x));
	else
		tmp = ((y / t_0) / (x + y)) * (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[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 8e-231], N[(N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42e+154], N[(N[(y / N[(t$95$0 * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / t$95$0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_0 := y - \left(-1 - x\right)\\
\mathbf{if}\;y \leq 8 \cdot 10^{-231}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\

\mathbf{elif}\;y \leq 1.42 \cdot 10^{+154}:\\
\;\;\;\;\frac{y}{t\_0 \cdot \left(y + x\right)} \cdot \frac{x}{y + x}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{t\_0}}{x + y} \cdot \frac{x}{y}\\


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

    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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.9999999999999999e-231 < y < 1.42e154

    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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

    if 1.42e154 < y

    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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 95.4% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\ \;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\ \mathbf{elif}\;x \leq -2.15 \cdot 10^{-14}:\\ \;\;\;\;\frac{x}{\left(y - \left(-1 - x\right)\right) \cdot \left(\left(y + x\right) \cdot \left(y + x\right)\right)} \cdot y\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{y}{y - -1} \cdot \frac{x}{y + x}}{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 -5e+110)
   (/ (/ (* (/ x (+ x y)) y) (- x -1.0)) (+ x y))
   (if (<= x -2.15e-14)
     (* (/ x (* (- y (- -1.0 x)) (* (+ y x) (+ y x)))) y)
     (/ (* (/ y (- y -1.0)) (/ x (+ y x))) (+ y x)))))
assert(x < y);
double code(double x, double y) {
	double tmp;
	if (x <= -5e+110) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (x <= -2.15e-14) {
		tmp = (x / ((y - (-1.0 - x)) * ((y + x) * (y + x)))) * y;
	} else {
		tmp = ((y / (y - -1.0)) * (x / (y + x))) / (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 <= (-5d+110)) then
        tmp = (((x / (x + y)) * y) / (x - (-1.0d0))) / (x + y)
    else if (x <= (-2.15d-14)) then
        tmp = (x / ((y - ((-1.0d0) - x)) * ((y + x) * (y + x)))) * y
    else
        tmp = ((y / (y - (-1.0d0))) * (x / (y + x))) / (y + x)
    end if
    code = tmp
end function
assert x < y;
public static double code(double x, double y) {
	double tmp;
	if (x <= -5e+110) {
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	} else if (x <= -2.15e-14) {
		tmp = (x / ((y - (-1.0 - x)) * ((y + x) * (y + x)))) * y;
	} else {
		tmp = ((y / (y - -1.0)) * (x / (y + x))) / (y + x);
	}
	return tmp;
}
[x, y] = sort([x, y])
def code(x, y):
	tmp = 0
	if x <= -5e+110:
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y)
	elif x <= -2.15e-14:
		tmp = (x / ((y - (-1.0 - x)) * ((y + x) * (y + x)))) * y
	else:
		tmp = ((y / (y - -1.0)) * (x / (y + x))) / (y + x)
	return tmp
x, y = sort([x, y])
function code(x, y)
	tmp = 0.0
	if (x <= -5e+110)
		tmp = Float64(Float64(Float64(Float64(x / Float64(x + y)) * y) / Float64(x - -1.0)) / Float64(x + y));
	elseif (x <= -2.15e-14)
		tmp = Float64(Float64(x / Float64(Float64(y - Float64(-1.0 - x)) * Float64(Float64(y + x) * Float64(y + x)))) * y);
	else
		tmp = Float64(Float64(Float64(y / Float64(y - -1.0)) * Float64(x / Float64(y + x))) / Float64(y + x));
	end
	return tmp
end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y)
	tmp = 0.0;
	if (x <= -5e+110)
		tmp = (((x / (x + y)) * y) / (x - -1.0)) / (x + y);
	elseif (x <= -2.15e-14)
		tmp = (x / ((y - (-1.0 - x)) * ((y + x) * (y + x)))) * y;
	else
		tmp = ((y / (y - -1.0)) * (x / (y + x))) / (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, -5e+110], N[(N[(N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.15e-14], N[(N[(x / N[(N[(y - N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] * N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(y / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\
\;\;\;\;\frac{\frac{\frac{x}{x + y} \cdot y}{x - -1}}{x + y}\\

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

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


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

    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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999978e110 < x < -2.14999999999999999e-14

    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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

    if -2.14999999999999999e-14 < 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. Step-by-step derivation
      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 95.1% accurate, 0.9× speedup?

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

      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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.0850000000000000061 < y

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 95.1% accurate, 0.9× speedup?

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

      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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.0850000000000000061 < y

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 95.0% accurate, 0.8× speedup?

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

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.30000000000000009e-26 < y < 0.0850000000000000061

      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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.0850000000000000061 < y

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 9: 94.4% accurate, 0.7× speedup?

    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\ \mathbf{elif}\;y \leq 0.085:\\ \;\;\;\;\frac{\frac{y}{x + y} \cdot x}{\left(x - -1\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+165}:\\ \;\;\;\;\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\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 (<= y -2.3e-26)
         (* (/ (/ y x) (+ x y)) t_0)
         (if (<= y 0.085)
           (/ (* (/ y (+ x y)) x) (* (- x -1.0) (+ x y)))
           (if (<= y 4.1e+165)
             (/ (* (/ y (- y -1.0)) x) (* (+ x y) (+ x y)))
             (* 1.0 (* t_0 (/ -1.0 (- (- -1.0 x) y)))))))))
    assert(x < y);
    double code(double x, double y) {
    	double t_0 = x / (y + x);
    	double tmp;
    	if (y <= -2.3e-26) {
    		tmp = ((y / x) / (x + y)) * t_0;
    	} else if (y <= 0.085) {
    		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
    	} else if (y <= 4.1e+165) {
    		tmp = ((y / (y - -1.0)) * x) / ((x + y) * (x + y));
    	} else {
    		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= (-2.3d-26)) then
            tmp = ((y / x) / (x + y)) * t_0
        else if (y <= 0.085d0) then
            tmp = ((y / (x + y)) * x) / ((x - (-1.0d0)) * (x + y))
        else if (y <= 4.1d+165) then
            tmp = ((y / (y - (-1.0d0))) * x) / ((x + y) * (x + y))
        else
            tmp = 1.0d0 * (t_0 * ((-1.0d0) / (((-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 (y <= -2.3e-26) {
    		tmp = ((y / x) / (x + y)) * t_0;
    	} else if (y <= 0.085) {
    		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
    	} else if (y <= 4.1e+165) {
    		tmp = ((y / (y - -1.0)) * x) / ((x + y) * (x + y));
    	} else {
    		tmp = 1.0 * (t_0 * (-1.0 / ((-1.0 - x) - y)));
    	}
    	return tmp;
    }
    
    [x, y] = sort([x, y])
    def code(x, y):
    	t_0 = x / (y + x)
    	tmp = 0
    	if y <= -2.3e-26:
    		tmp = ((y / x) / (x + y)) * t_0
    	elif y <= 0.085:
    		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y))
    	elif y <= 4.1e+165:
    		tmp = ((y / (y - -1.0)) * x) / ((x + y) * (x + y))
    	else:
    		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= -2.3e-26)
    		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_0);
    	elseif (y <= 0.085)
    		tmp = Float64(Float64(Float64(y / Float64(x + y)) * x) / Float64(Float64(x - -1.0) * Float64(x + y)));
    	elseif (y <= 4.1e+165)
    		tmp = Float64(Float64(Float64(y / Float64(y - -1.0)) * x) / Float64(Float64(x + y) * Float64(x + y)));
    	else
    		tmp = Float64(1.0 * Float64(t_0 * Float64(-1.0 / 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 (y <= -2.3e-26)
    		tmp = ((y / x) / (x + y)) * t_0;
    	elseif (y <= 0.085)
    		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
    	elseif (y <= 4.1e+165)
    		tmp = ((y / (y - -1.0)) * x) / ((x + y) * (x + y));
    	else
    		tmp = 1.0 * (t_0 * (-1.0 / ((-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[y, -2.3e-26], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 0.085], N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+165], N[(N[(N[(y / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(t$95$0 * N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    [x, y] = \mathsf{sort}([x, y])\\
    \\
    \begin{array}{l}
    t_0 := \frac{x}{y + x}\\
    \mathbf{if}\;y \leq -2.3 \cdot 10^{-26}:\\
    \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\
    
    \mathbf{elif}\;y \leq 0.085:\\
    \;\;\;\;\frac{\frac{y}{x + y} \cdot x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
    
    \mathbf{elif}\;y \leq 4.1 \cdot 10^{+165}:\\
    \;\;\;\;\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\left(-1 - x\right) - y}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y < -2.30000000000000009e-26

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.30000000000000009e-26 < y < 0.0850000000000000061

      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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.0850000000000000061 < y < 4.1000000000000003e165

      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. Step-by-step derivation
        1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 4.1000000000000003e165 < y

        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. Step-by-step derivation
          1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 94.0% accurate, 0.7× speedup?

        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{-26}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\ \mathbf{elif}\;y \leq 0.085:\\ \;\;\;\;\frac{\frac{y}{x + y} \cdot x}{\left(x - -1\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\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 (<= y -2.3e-26)
             (* (/ (/ y x) (+ x y)) t_0)
             (if (<= y 0.085)
               (/ (* (/ y (+ x y)) x) (* (- x -1.0) (+ x y)))
               (if (<= y 5.8e+102)
                 (* x (/ y (* (- y -1.0) (* (+ x y) (+ x y)))))
                 (* 1.0 (* t_0 (/ -1.0 (- (- -1.0 x) y)))))))))
        assert(x < y);
        double code(double x, double y) {
        	double t_0 = x / (y + x);
        	double tmp;
        	if (y <= -2.3e-26) {
        		tmp = ((y / x) / (x + y)) * t_0;
        	} else if (y <= 0.085) {
        		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
        	} else if (y <= 5.8e+102) {
        		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
        	} else {
        		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= (-2.3d-26)) then
                tmp = ((y / x) / (x + y)) * t_0
            else if (y <= 0.085d0) then
                tmp = ((y / (x + y)) * x) / ((x - (-1.0d0)) * (x + y))
            else if (y <= 5.8d+102) then
                tmp = x * (y / ((y - (-1.0d0)) * ((x + y) * (x + y))))
            else
                tmp = 1.0d0 * (t_0 * ((-1.0d0) / (((-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 (y <= -2.3e-26) {
        		tmp = ((y / x) / (x + y)) * t_0;
        	} else if (y <= 0.085) {
        		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
        	} else if (y <= 5.8e+102) {
        		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
        	} else {
        		tmp = 1.0 * (t_0 * (-1.0 / ((-1.0 - x) - y)));
        	}
        	return tmp;
        }
        
        [x, y] = sort([x, y])
        def code(x, y):
        	t_0 = x / (y + x)
        	tmp = 0
        	if y <= -2.3e-26:
        		tmp = ((y / x) / (x + y)) * t_0
        	elif y <= 0.085:
        		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y))
        	elif y <= 5.8e+102:
        		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))))
        	else:
        		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= -2.3e-26)
        		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_0);
        	elseif (y <= 0.085)
        		tmp = Float64(Float64(Float64(y / Float64(x + y)) * x) / Float64(Float64(x - -1.0) * Float64(x + y)));
        	elseif (y <= 5.8e+102)
        		tmp = Float64(x * Float64(y / Float64(Float64(y - -1.0) * Float64(Float64(x + y) * Float64(x + y)))));
        	else
        		tmp = Float64(1.0 * Float64(t_0 * Float64(-1.0 / 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 (y <= -2.3e-26)
        		tmp = ((y / x) / (x + y)) * t_0;
        	elseif (y <= 0.085)
        		tmp = ((y / (x + y)) * x) / ((x - -1.0) * (x + y));
        	elseif (y <= 5.8e+102)
        		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
        	else
        		tmp = 1.0 * (t_0 * (-1.0 / ((-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[y, -2.3e-26], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 0.085], N[(N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+102], N[(x * N[(y / N[(N[(y - -1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(t$95$0 * N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        [x, y] = \mathsf{sort}([x, y])\\
        \\
        \begin{array}{l}
        t_0 := \frac{x}{y + x}\\
        \mathbf{if}\;y \leq -2.3 \cdot 10^{-26}:\\
        \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\
        
        \mathbf{elif}\;y \leq 0.085:\\
        \;\;\;\;\frac{\frac{y}{x + y} \cdot x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
        
        \mathbf{elif}\;y \leq 5.8 \cdot 10^{+102}:\\
        \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\left(-1 - x\right) - y}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if y < -2.30000000000000009e-26

          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. Step-by-step derivation
            1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -2.30000000000000009e-26 < y < 0.0850000000000000061

          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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 0.0850000000000000061 < y < 5.8000000000000005e102

          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. Step-by-step derivation
            1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 5.8000000000000005e102 < y

            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. Step-by-step derivation
              1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 11: 93.8% accurate, 0.7× speedup?

            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;y \leq -1.06 \cdot 10^{-57}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\ \mathbf{elif}\;y \leq 0.085:\\ \;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\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 (<= y -1.06e-57)
                 (* (/ (/ y x) (+ x y)) t_0)
                 (if (<= y 0.085)
                   (* (/ y (+ x y)) (/ x (* (- x -1.0) (+ x y))))
                   (if (<= y 5.8e+102)
                     (* x (/ y (* (- y -1.0) (* (+ x y) (+ x y)))))
                     (* 1.0 (* t_0 (/ -1.0 (- (- -1.0 x) y)))))))))
            assert(x < y);
            double code(double x, double y) {
            	double t_0 = x / (y + x);
            	double tmp;
            	if (y <= -1.06e-57) {
            		tmp = ((y / x) / (x + y)) * t_0;
            	} else if (y <= 0.085) {
            		tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
            	} else if (y <= 5.8e+102) {
            		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
            	} else {
            		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= (-1.06d-57)) then
                    tmp = ((y / x) / (x + y)) * t_0
                else if (y <= 0.085d0) then
                    tmp = (y / (x + y)) * (x / ((x - (-1.0d0)) * (x + y)))
                else if (y <= 5.8d+102) then
                    tmp = x * (y / ((y - (-1.0d0)) * ((x + y) * (x + y))))
                else
                    tmp = 1.0d0 * (t_0 * ((-1.0d0) / (((-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 (y <= -1.06e-57) {
            		tmp = ((y / x) / (x + y)) * t_0;
            	} else if (y <= 0.085) {
            		tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
            	} else if (y <= 5.8e+102) {
            		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
            	} else {
            		tmp = 1.0 * (t_0 * (-1.0 / ((-1.0 - x) - y)));
            	}
            	return tmp;
            }
            
            [x, y] = sort([x, y])
            def code(x, y):
            	t_0 = x / (y + x)
            	tmp = 0
            	if y <= -1.06e-57:
            		tmp = ((y / x) / (x + y)) * t_0
            	elif y <= 0.085:
            		tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)))
            	elif y <= 5.8e+102:
            		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))))
            	else:
            		tmp = 1.0 * (t_0 * (-1.0 / ((-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 (y <= -1.06e-57)
            		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_0);
            	elseif (y <= 0.085)
            		tmp = Float64(Float64(y / Float64(x + y)) * Float64(x / Float64(Float64(x - -1.0) * Float64(x + y))));
            	elseif (y <= 5.8e+102)
            		tmp = Float64(x * Float64(y / Float64(Float64(y - -1.0) * Float64(Float64(x + y) * Float64(x + y)))));
            	else
            		tmp = Float64(1.0 * Float64(t_0 * Float64(-1.0 / 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 (y <= -1.06e-57)
            		tmp = ((y / x) / (x + y)) * t_0;
            	elseif (y <= 0.085)
            		tmp = (y / (x + y)) * (x / ((x - -1.0) * (x + y)));
            	elseif (y <= 5.8e+102)
            		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
            	else
            		tmp = 1.0 * (t_0 * (-1.0 / ((-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[y, -1.06e-57], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[y, 0.085], N[(N[(y / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(x - -1.0), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.8e+102], N[(x * N[(y / N[(N[(y - -1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(t$95$0 * N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            [x, y] = \mathsf{sort}([x, y])\\
            \\
            \begin{array}{l}
            t_0 := \frac{x}{y + x}\\
            \mathbf{if}\;y \leq -1.06 \cdot 10^{-57}:\\
            \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_0\\
            
            \mathbf{elif}\;y \leq 0.085:\\
            \;\;\;\;\frac{y}{x + y} \cdot \frac{x}{\left(x - -1\right) \cdot \left(x + y\right)}\\
            
            \mathbf{elif}\;y \leq 5.8 \cdot 10^{+102}:\\
            \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;1 \cdot \left(t\_0 \cdot \frac{-1}{\left(-1 - x\right) - y}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if y < -1.0600000000000001e-57

              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. Step-by-step derivation
                1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -1.0600000000000001e-57 < y < 0.0850000000000000061

              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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 0.0850000000000000061 < y < 5.8000000000000005e102

              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. Step-by-step derivation
                1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 5.8000000000000005e102 < y

                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. Step-by-step derivation
                  1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 90.8% accurate, 0.7× speedup?

                \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \left(x + y\right) \cdot \left(x + y\right)\\ t_1 := \frac{x}{y + x}\\ \mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_1\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-9}:\\ \;\;\;\;y \cdot \frac{x}{\left(x - -1\right) \cdot t\_0}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\ \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(t\_1 \cdot \frac{-1}{\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 y))) (t_1 (/ x (+ y x))))
                   (if (<= x -5e+110)
                     (* (/ (/ y x) (+ x y)) t_1)
                     (if (<= x -1.7e-9)
                       (* y (/ x (* (- x -1.0) t_0)))
                       (if (<= x -3.3e-190)
                         (* x (/ y (* (- y -1.0) t_0)))
                         (* 1.0 (* t_1 (/ -1.0 (- (- -1.0 x) y)))))))))
                assert(x < y);
                double code(double x, double y) {
                	double t_0 = (x + y) * (x + y);
                	double t_1 = x / (y + x);
                	double tmp;
                	if (x <= -5e+110) {
                		tmp = ((y / x) / (x + y)) * t_1;
                	} else if (x <= -1.7e-9) {
                		tmp = y * (x / ((x - -1.0) * t_0));
                	} else if (x <= -3.3e-190) {
                		tmp = x * (y / ((y - -1.0) * t_0));
                	} else {
                		tmp = 1.0 * (t_1 * (-1.0 / ((-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) :: t_1
                    real(8) :: tmp
                    t_0 = (x + y) * (x + y)
                    t_1 = x / (y + x)
                    if (x <= (-5d+110)) then
                        tmp = ((y / x) / (x + y)) * t_1
                    else if (x <= (-1.7d-9)) then
                        tmp = y * (x / ((x - (-1.0d0)) * t_0))
                    else if (x <= (-3.3d-190)) then
                        tmp = x * (y / ((y - (-1.0d0)) * t_0))
                    else
                        tmp = 1.0d0 * (t_1 * ((-1.0d0) / (((-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 + y);
                	double t_1 = x / (y + x);
                	double tmp;
                	if (x <= -5e+110) {
                		tmp = ((y / x) / (x + y)) * t_1;
                	} else if (x <= -1.7e-9) {
                		tmp = y * (x / ((x - -1.0) * t_0));
                	} else if (x <= -3.3e-190) {
                		tmp = x * (y / ((y - -1.0) * t_0));
                	} else {
                		tmp = 1.0 * (t_1 * (-1.0 / ((-1.0 - x) - y)));
                	}
                	return tmp;
                }
                
                [x, y] = sort([x, y])
                def code(x, y):
                	t_0 = (x + y) * (x + y)
                	t_1 = x / (y + x)
                	tmp = 0
                	if x <= -5e+110:
                		tmp = ((y / x) / (x + y)) * t_1
                	elif x <= -1.7e-9:
                		tmp = y * (x / ((x - -1.0) * t_0))
                	elif x <= -3.3e-190:
                		tmp = x * (y / ((y - -1.0) * t_0))
                	else:
                		tmp = 1.0 * (t_1 * (-1.0 / ((-1.0 - x) - y)))
                	return tmp
                
                x, y = sort([x, y])
                function code(x, y)
                	t_0 = Float64(Float64(x + y) * Float64(x + y))
                	t_1 = Float64(x / Float64(y + x))
                	tmp = 0.0
                	if (x <= -5e+110)
                		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * t_1);
                	elseif (x <= -1.7e-9)
                		tmp = Float64(y * Float64(x / Float64(Float64(x - -1.0) * t_0)));
                	elseif (x <= -3.3e-190)
                		tmp = Float64(x * Float64(y / Float64(Float64(y - -1.0) * t_0)));
                	else
                		tmp = Float64(1.0 * Float64(t_1 * Float64(-1.0 / 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 + y);
                	t_1 = x / (y + x);
                	tmp = 0.0;
                	if (x <= -5e+110)
                		tmp = ((y / x) / (x + y)) * t_1;
                	elseif (x <= -1.7e-9)
                		tmp = y * (x / ((x - -1.0) * t_0));
                	elseif (x <= -3.3e-190)
                		tmp = x * (y / ((y - -1.0) * t_0));
                	else
                		tmp = 1.0 * (t_1 * (-1.0 / ((-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[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+110], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[x, -1.7e-9], N[(y * N[(x / N[(N[(x - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-190], N[(x * N[(y / N[(N[(y - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(t$95$1 * N[(-1.0 / N[(N[(-1.0 - x), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                
                \begin{array}{l}
                [x, y] = \mathsf{sort}([x, y])\\
                \\
                \begin{array}{l}
                t_0 := \left(x + y\right) \cdot \left(x + y\right)\\
                t_1 := \frac{x}{y + x}\\
                \mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\
                \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot t\_1\\
                
                \mathbf{elif}\;x \leq -1.7 \cdot 10^{-9}:\\
                \;\;\;\;y \cdot \frac{x}{\left(x - -1\right) \cdot t\_0}\\
                
                \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\
                \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot t\_0}\\
                
                \mathbf{else}:\\
                \;\;\;\;1 \cdot \left(t\_1 \cdot \frac{-1}{\left(-1 - x\right) - y}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if x < -4.99999999999999978e110

                  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. Step-by-step derivation
                    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -4.99999999999999978e110 < x < -1.6999999999999999e-9

                  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 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -1.6999999999999999e-9 < x < -3.30000000000000019e-190

                  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. Step-by-step derivation
                    1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -3.30000000000000019e-190 < 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. Step-by-step derivation
                      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{y}{y + x} \cdot \left(\frac{x}{\color{blue}{y + x}} \cdot \frac{1}{\left(x + y\right) + 1}\right) \]
                      20. frac-2negN/A

                        \[\leadsto \frac{y}{y + x} \cdot \left(\frac{x}{y + x} \cdot \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(\left(x + y\right) + 1\right)\right)}}\right) \]
                      21. lower-/.f64N/A

                        \[\leadsto \frac{y}{y + x} \cdot \left(\frac{x}{y + x} \cdot \color{blue}{\frac{\mathsf{neg}\left(1\right)}{\mathsf{neg}\left(\left(\left(x + y\right) + 1\right)\right)}}\right) \]
                      22. metadata-evalN/A

                        \[\leadsto \frac{y}{y + x} \cdot \left(\frac{x}{y + x} \cdot \frac{\color{blue}{-1}}{\mathsf{neg}\left(\left(\left(x + y\right) + 1\right)\right)}\right) \]
                    3. Applied rewrites99.8%

                      \[\leadsto \color{blue}{\frac{y}{y + x} \cdot \left(\frac{x}{y + x} \cdot \frac{-1}{\left(-1 - x\right) - y}\right)} \]
                    4. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{1} \cdot \left(\frac{x}{y + x} \cdot \frac{-1}{\left(-1 - x\right) - y}\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites50.8%

                        \[\leadsto \color{blue}{1} \cdot \left(\frac{x}{y + x} \cdot \frac{-1}{\left(-1 - x\right) - y}\right) \]
                    6. Recombined 4 regimes into one program.
                    7. Add Preprocessing

                    Alternative 13: 90.7% accurate, 0.7× speedup?

                    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \left(x + y\right) \cdot \left(x + y\right)\\ \mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot \frac{x}{y + x}\\ \mathbf{elif}\;x \leq -1.7 \cdot 10^{-9}:\\ \;\;\;\;y \cdot \frac{x}{\left(x - -1\right) \cdot t\_0}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\ \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 y))))
                       (if (<= x -5e+110)
                         (* (/ (/ y x) (+ x y)) (/ x (+ y x)))
                         (if (<= x -1.7e-9)
                           (* y (/ x (* (- x -1.0) t_0)))
                           (if (<= x -3.3e-190)
                             (* x (/ y (* (- y -1.0) t_0)))
                             (/ (/ x (- y -1.0)) (+ y x)))))))
                    assert(x < y);
                    double code(double x, double y) {
                    	double t_0 = (x + y) * (x + y);
                    	double tmp;
                    	if (x <= -5e+110) {
                    		tmp = ((y / x) / (x + y)) * (x / (y + x));
                    	} else if (x <= -1.7e-9) {
                    		tmp = y * (x / ((x - -1.0) * t_0));
                    	} else if (x <= -3.3e-190) {
                    		tmp = x * (y / ((y - -1.0) * t_0));
                    	} else {
                    		tmp = (x / (y - -1.0)) / (y + x);
                    	}
                    	return tmp;
                    }
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    module fmin_fmax_functions
                        implicit none
                        private
                        public fmax
                        public fmin
                    
                        interface fmax
                            module procedure fmax88
                            module procedure fmax44
                            module procedure fmax84
                            module procedure fmax48
                        end interface
                        interface fmin
                            module procedure fmin88
                            module procedure fmin44
                            module procedure fmin84
                            module procedure fmin48
                        end interface
                    contains
                        real(8) function fmax88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmax44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmax84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmax48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                        end function
                        real(8) function fmin88(x, y) result (res)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(4) function fmin44(x, y) result (res)
                            real(4), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                        end function
                        real(8) function fmin84(x, y) result(res)
                            real(8), intent (in) :: x
                            real(4), intent (in) :: y
                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                        end function
                        real(8) function fmin48(x, y) result(res)
                            real(4), intent (in) :: x
                            real(8), intent (in) :: y
                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                        end function
                    end module
                    
                    real(8) function code(x, y)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = (x + y) * (x + y)
                        if (x <= (-5d+110)) then
                            tmp = ((y / x) / (x + y)) * (x / (y + x))
                        else if (x <= (-1.7d-9)) then
                            tmp = y * (x / ((x - (-1.0d0)) * t_0))
                        else if (x <= (-3.3d-190)) then
                            tmp = x * (y / ((y - (-1.0d0)) * t_0))
                        else
                            tmp = (x / (y - (-1.0d0))) / (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 + y);
                    	double tmp;
                    	if (x <= -5e+110) {
                    		tmp = ((y / x) / (x + y)) * (x / (y + x));
                    	} else if (x <= -1.7e-9) {
                    		tmp = y * (x / ((x - -1.0) * t_0));
                    	} else if (x <= -3.3e-190) {
                    		tmp = x * (y / ((y - -1.0) * t_0));
                    	} else {
                    		tmp = (x / (y - -1.0)) / (y + x);
                    	}
                    	return tmp;
                    }
                    
                    [x, y] = sort([x, y])
                    def code(x, y):
                    	t_0 = (x + y) * (x + y)
                    	tmp = 0
                    	if x <= -5e+110:
                    		tmp = ((y / x) / (x + y)) * (x / (y + x))
                    	elif x <= -1.7e-9:
                    		tmp = y * (x / ((x - -1.0) * t_0))
                    	elif x <= -3.3e-190:
                    		tmp = x * (y / ((y - -1.0) * t_0))
                    	else:
                    		tmp = (x / (y - -1.0)) / (y + x)
                    	return tmp
                    
                    x, y = sort([x, y])
                    function code(x, y)
                    	t_0 = Float64(Float64(x + y) * Float64(x + y))
                    	tmp = 0.0
                    	if (x <= -5e+110)
                    		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * Float64(x / Float64(y + x)));
                    	elseif (x <= -1.7e-9)
                    		tmp = Float64(y * Float64(x / Float64(Float64(x - -1.0) * t_0)));
                    	elseif (x <= -3.3e-190)
                    		tmp = Float64(x * Float64(y / Float64(Float64(y - -1.0) * t_0)));
                    	else
                    		tmp = Float64(Float64(x / Float64(y - -1.0)) / Float64(y + x));
                    	end
                    	return tmp
                    end
                    
                    x, y = num2cell(sort([x, y])){:}
                    function tmp_2 = code(x, y)
                    	t_0 = (x + y) * (x + y);
                    	tmp = 0.0;
                    	if (x <= -5e+110)
                    		tmp = ((y / x) / (x + y)) * (x / (y + x));
                    	elseif (x <= -1.7e-9)
                    		tmp = y * (x / ((x - -1.0) * t_0));
                    	elseif (x <= -3.3e-190)
                    		tmp = x * (y / ((y - -1.0) * t_0));
                    	else
                    		tmp = (x / (y - -1.0)) / (y + x);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    NOTE: x and y should be sorted in increasing order before calling this function.
                    code[x_, y_] := Block[{t$95$0 = N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+110], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.7e-9], N[(y * N[(x / N[(N[(x - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-190], N[(x * N[(y / N[(N[(y - -1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    [x, y] = \mathsf{sort}([x, y])\\
                    \\
                    \begin{array}{l}
                    t_0 := \left(x + y\right) \cdot \left(x + y\right)\\
                    \mathbf{if}\;x \leq -5 \cdot 10^{+110}:\\
                    \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot \frac{x}{y + x}\\
                    
                    \mathbf{elif}\;x \leq -1.7 \cdot 10^{-9}:\\
                    \;\;\;\;y \cdot \frac{x}{\left(x - -1\right) \cdot t\_0}\\
                    
                    \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\
                    \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot t\_0}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\frac{x}{y - -1}}{y + x}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if x < -4.99999999999999978e110

                      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. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                        3. lift-*.f64N/A

                          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                        4. associate-*l*N/A

                          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
                        5. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
                        6. times-fracN/A

                          \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                        7. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \cdot \frac{x}{x + y}} \]
                        8. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \cdot \frac{x}{x + y}} \]
                      3. Applied rewrites94.1%

                        \[\leadsto \color{blue}{\frac{y}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + x}} \]
                      4. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{y}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)}} \cdot \frac{x}{y + x} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{y}{\color{blue}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)}} \cdot \frac{x}{y + x} \]
                        3. associate-/r*N/A

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{y + x}} \cdot \frac{x}{y + x} \]
                        4. lift-/.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{y}{y - \left(-1 - x\right)}}}{y + x} \cdot \frac{x}{y + x} \]
                        5. lift-+.f64N/A

                          \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{y + x}} \cdot \frac{x}{y + x} \]
                        6. +-commutativeN/A

                          \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{x + y}} \cdot \frac{x}{y + x} \]
                        7. lift-+.f64N/A

                          \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{x + y}} \cdot \frac{x}{y + x} \]
                        8. lower-/.f6499.8

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{x + y}} \cdot \frac{x}{y + x} \]
                      5. Applied rewrites99.8%

                        \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{x + y}} \cdot \frac{x}{y + x} \]
                      6. Taylor expanded in x around inf

                        \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{y + x} \]
                      7. Step-by-step derivation
                        1. lower-/.f6438.9

                          \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{x + y} \cdot \frac{x}{y + x} \]
                      8. Applied rewrites38.9%

                        \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{y + x} \]

                      if -4.99999999999999978e110 < x < -1.6999999999999999e-9

                      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 0

                        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(1 + x\right)}} \]
                      3. Step-by-step derivation
                        1. lower-+.f6459.4

                          \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + \color{blue}{x}\right)} \]
                      4. Applied rewrites59.4%

                        \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(1 + x\right)}} \]
                      5. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{y \cdot x}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)} \]
                        4. associate-/l*N/A

                          \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                        5. lower-*.f64N/A

                          \[\leadsto \color{blue}{y \cdot \frac{x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                        6. lower-/.f6475.7

                          \[\leadsto y \cdot \color{blue}{\frac{x}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                        7. lift-*.f64N/A

                          \[\leadsto y \cdot \frac{x}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                        8. *-commutativeN/A

                          \[\leadsto y \cdot \frac{x}{\color{blue}{\left(1 + x\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                        9. lower-*.f6475.7

                          \[\leadsto y \cdot \frac{x}{\color{blue}{\left(1 + x\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                        10. lift-+.f64N/A

                          \[\leadsto y \cdot \frac{x}{\left(1 + \color{blue}{x}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                        11. +-commutativeN/A

                          \[\leadsto y \cdot \frac{x}{\left(x + \color{blue}{1}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                        12. add-flip-revN/A

                          \[\leadsto y \cdot \frac{x}{\left(x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                        13. metadata-evalN/A

                          \[\leadsto y \cdot \frac{x}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                        14. lower--.f6475.7

                          \[\leadsto y \cdot \frac{x}{\left(x - \color{blue}{-1}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                      6. Applied rewrites75.7%

                        \[\leadsto \color{blue}{y \cdot \frac{x}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]

                      if -1.6999999999999999e-9 < x < -3.30000000000000019e-190

                      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. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                        2. lift-*.f64N/A

                          \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                        3. lift-*.f64N/A

                          \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                        4. times-fracN/A

                          \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                        5. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                        6. lift-*.f64N/A

                          \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                        7. associate-/r*N/A

                          \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                        8. associate-*r/N/A

                          \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                        9. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                      3. Applied rewrites99.8%

                        \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                      4. Taylor expanded in x around 0

                        \[\leadsto \frac{\frac{y}{y - \color{blue}{-1}} \cdot \frac{x}{y + x}}{y + x} \]
                      5. Step-by-step derivation
                        1. Applied rewrites74.7%

                          \[\leadsto \frac{\frac{y}{y - \color{blue}{-1}} \cdot \frac{x}{y + x}}{y + x} \]
                        2. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot \frac{x}{y + x}}{y + x}} \]
                          2. lift-*.f64N/A

                            \[\leadsto \frac{\color{blue}{\frac{y}{y - -1} \cdot \frac{x}{y + x}}}{y + x} \]
                          3. lift-/.f64N/A

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot \color{blue}{\frac{x}{y + x}}}{y + x} \]
                          4. associate-*r/N/A

                            \[\leadsto \frac{\color{blue}{\frac{\frac{y}{y - -1} \cdot x}{y + x}}}{y + x} \]
                          5. lift-+.f64N/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{y + x}}}{y + x} \]
                          6. +-commutativeN/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{x + y}}}{y + x} \]
                          7. lift-+.f64N/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{x + y}}}{y + x} \]
                          8. lift-+.f64N/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{y + x}} \]
                          9. +-commutativeN/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{x + y}} \]
                          10. lift-+.f64N/A

                            \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{x + y}} \]
                          11. associate-/l/N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          12. lift-+.f64N/A

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)} \]
                          13. lift-+.f64N/A

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \]
                          14. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          15. lower-*.f64N/A

                            \[\leadsto \frac{\color{blue}{\frac{y}{y - -1} \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)} \]
                          16. lift-+.f64N/A

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)} \]
                          17. lift-+.f64N/A

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \]
                          18. lower-*.f6469.4

                            \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                        3. Applied rewrites69.4%

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                        4. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          2. mult-flipN/A

                            \[\leadsto \color{blue}{\left(\frac{y}{y - -1} \cdot x\right) \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          3. lift-*.f64N/A

                            \[\leadsto \color{blue}{\left(\frac{y}{y - -1} \cdot x\right)} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \]
                          4. *-commutativeN/A

                            \[\leadsto \color{blue}{\left(x \cdot \frac{y}{y - -1}\right)} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \]
                          5. associate-*l*N/A

                            \[\leadsto \color{blue}{x \cdot \left(\frac{y}{y - -1} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right)} \]
                          6. lower-*.f64N/A

                            \[\leadsto \color{blue}{x \cdot \left(\frac{y}{y - -1} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right)} \]
                          7. lift-/.f64N/A

                            \[\leadsto x \cdot \left(\color{blue}{\frac{y}{y - -1}} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right) \]
                          8. frac-timesN/A

                            \[\leadsto x \cdot \color{blue}{\frac{y \cdot 1}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                          9. *-rgt-identityN/A

                            \[\leadsto x \cdot \frac{\color{blue}{y}}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                          10. lower-/.f64N/A

                            \[\leadsto x \cdot \color{blue}{\frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                          11. lower-*.f6475.4

                            \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                        5. Applied rewrites75.4%

                          \[\leadsto \color{blue}{x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]

                        if -3.30000000000000019e-190 < 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. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          2. lift-*.f64N/A

                            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          4. times-fracN/A

                            \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                          5. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          7. associate-/r*N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                          8. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          9. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                        3. Applied rewrites99.8%

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                        4. Taylor expanded in x around 0

                          \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                        5. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                          2. lower-+.f6450.0

                            \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                        6. Applied rewrites50.0%

                          \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                        7. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                          2. +-commutativeN/A

                            \[\leadsto \frac{\frac{x}{y + \color{blue}{1}}}{y + x} \]
                          3. add-flip-revN/A

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}}{y + x} \]
                          4. metadata-evalN/A

                            \[\leadsto \frac{\frac{x}{y - -1}}{y + x} \]
                          5. lower--.f6450.0

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                        8. Applied rewrites50.0%

                          \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                      6. Recombined 4 regimes into one program.
                      7. Add Preprocessing

                      Alternative 14: 89.2% accurate, 0.8× speedup?

                      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1.42 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\ \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\ \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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.42e-6)
                         (/ (/ y (- x -1.0)) (+ y x))
                         (if (<= x -3.3e-190)
                           (* x (/ y (* (- y -1.0) (* (+ x y) (+ x y)))))
                           (/ (/ x (- y -1.0)) (+ y x)))))
                      assert(x < y);
                      double code(double x, double y) {
                      	double tmp;
                      	if (x <= -1.42e-6) {
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	} else if (x <= -3.3e-190) {
                      		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
                      	} else {
                      		tmp = (x / (y - -1.0)) / (y + x);
                      	}
                      	return tmp;
                      }
                      
                      NOTE: x and y should be sorted in increasing order before calling this function.
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(x, y)
                      use fmin_fmax_functions
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8) :: tmp
                          if (x <= (-1.42d-6)) then
                              tmp = (y / (x - (-1.0d0))) / (y + x)
                          else if (x <= (-3.3d-190)) then
                              tmp = x * (y / ((y - (-1.0d0)) * ((x + y) * (x + y))))
                          else
                              tmp = (x / (y - (-1.0d0))) / (y + x)
                          end if
                          code = tmp
                      end function
                      
                      assert x < y;
                      public static double code(double x, double y) {
                      	double tmp;
                      	if (x <= -1.42e-6) {
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	} else if (x <= -3.3e-190) {
                      		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
                      	} else {
                      		tmp = (x / (y - -1.0)) / (y + x);
                      	}
                      	return tmp;
                      }
                      
                      [x, y] = sort([x, y])
                      def code(x, y):
                      	tmp = 0
                      	if x <= -1.42e-6:
                      		tmp = (y / (x - -1.0)) / (y + x)
                      	elif x <= -3.3e-190:
                      		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))))
                      	else:
                      		tmp = (x / (y - -1.0)) / (y + x)
                      	return tmp
                      
                      x, y = sort([x, y])
                      function code(x, y)
                      	tmp = 0.0
                      	if (x <= -1.42e-6)
                      		tmp = Float64(Float64(y / Float64(x - -1.0)) / Float64(y + x));
                      	elseif (x <= -3.3e-190)
                      		tmp = Float64(x * Float64(y / Float64(Float64(y - -1.0) * Float64(Float64(x + y) * Float64(x + y)))));
                      	else
                      		tmp = Float64(Float64(x / Float64(y - -1.0)) / Float64(y + x));
                      	end
                      	return tmp
                      end
                      
                      x, y = num2cell(sort([x, y])){:}
                      function tmp_2 = code(x, y)
                      	tmp = 0.0;
                      	if (x <= -1.42e-6)
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	elseif (x <= -3.3e-190)
                      		tmp = x * (y / ((y - -1.0) * ((x + y) * (x + y))));
                      	else
                      		tmp = (x / (y - -1.0)) / (y + x);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      NOTE: x and y should be sorted in increasing order before calling this function.
                      code[x_, y_] := If[LessEqual[x, -1.42e-6], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.3e-190], N[(x * N[(y / N[(N[(y - -1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      [x, y] = \mathsf{sort}([x, y])\\
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;x \leq -1.42 \cdot 10^{-6}:\\
                      \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\
                      
                      \mathbf{elif}\;x \leq -3.3 \cdot 10^{-190}:\\
                      \;\;\;\;x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{\frac{x}{y - -1}}{y + x}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if x < -1.42e-6

                        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. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          2. lift-*.f64N/A

                            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          4. times-fracN/A

                            \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                          5. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          7. associate-/r*N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                          8. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          9. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                        3. Applied rewrites99.8%

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                        4. Taylor expanded in y around 0

                          \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
                        5. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{\frac{y}{\color{blue}{1 + x}}}{y + x} \]
                          2. lower-+.f6451.6

                            \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
                        6. Applied rewrites51.6%

                          \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
                        7. Step-by-step derivation
                          1. lift-+.f64N/A

                            \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
                          2. +-commutativeN/A

                            \[\leadsto \frac{\frac{y}{x + \color{blue}{1}}}{y + x} \]
                          3. metadata-evalN/A

                            \[\leadsto \frac{\frac{y}{x + \left(\mathsf{neg}\left(-1\right)\right)}}{y + x} \]
                          4. sub-flipN/A

                            \[\leadsto \frac{\frac{y}{x - \color{blue}{-1}}}{y + x} \]
                          5. lift--.f6451.6

                            \[\leadsto \frac{\frac{y}{x - \color{blue}{-1}}}{y + x} \]
                        8. Applied rewrites51.6%

                          \[\leadsto \frac{\color{blue}{\frac{y}{x - -1}}}{y + x} \]

                        if -1.42e-6 < x < -3.30000000000000019e-190

                        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. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          2. lift-*.f64N/A

                            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          4. times-fracN/A

                            \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                          5. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          7. associate-/r*N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                          8. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          9. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                        3. Applied rewrites99.8%

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                        4. Taylor expanded in x around 0

                          \[\leadsto \frac{\frac{y}{y - \color{blue}{-1}} \cdot \frac{x}{y + x}}{y + x} \]
                        5. Step-by-step derivation
                          1. Applied rewrites74.7%

                            \[\leadsto \frac{\frac{y}{y - \color{blue}{-1}} \cdot \frac{x}{y + x}}{y + x} \]
                          2. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot \frac{x}{y + x}}{y + x}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{\frac{y}{y - -1} \cdot \frac{x}{y + x}}}{y + x} \]
                            3. lift-/.f64N/A

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot \color{blue}{\frac{x}{y + x}}}{y + x} \]
                            4. associate-*r/N/A

                              \[\leadsto \frac{\color{blue}{\frac{\frac{y}{y - -1} \cdot x}{y + x}}}{y + x} \]
                            5. lift-+.f64N/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{y + x}}}{y + x} \]
                            6. +-commutativeN/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{x + y}}}{y + x} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{\color{blue}{x + y}}}{y + x} \]
                            8. lift-+.f64N/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{y + x}} \]
                            9. +-commutativeN/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{x + y}} \]
                            10. lift-+.f64N/A

                              \[\leadsto \frac{\frac{\frac{y}{y - -1} \cdot x}{x + y}}{\color{blue}{x + y}} \]
                            11. associate-/l/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            12. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)} \]
                            13. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \]
                            14. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            15. lower-*.f64N/A

                              \[\leadsto \frac{\color{blue}{\frac{y}{y - -1} \cdot x}}{\left(x + y\right) \cdot \left(x + y\right)} \]
                            16. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right)} \cdot \left(x + y\right)} \]
                            17. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \color{blue}{\left(x + y\right)}} \]
                            18. lower-*.f6469.4

                              \[\leadsto \frac{\frac{y}{y - -1} \cdot x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          3. Applied rewrites69.4%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          4. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - -1} \cdot x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            2. mult-flipN/A

                              \[\leadsto \color{blue}{\left(\frac{y}{y - -1} \cdot x\right) \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            3. lift-*.f64N/A

                              \[\leadsto \color{blue}{\left(\frac{y}{y - -1} \cdot x\right)} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \]
                            4. *-commutativeN/A

                              \[\leadsto \color{blue}{\left(x \cdot \frac{y}{y - -1}\right)} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)} \]
                            5. associate-*l*N/A

                              \[\leadsto \color{blue}{x \cdot \left(\frac{y}{y - -1} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right)} \]
                            6. lower-*.f64N/A

                              \[\leadsto \color{blue}{x \cdot \left(\frac{y}{y - -1} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right)} \]
                            7. lift-/.f64N/A

                              \[\leadsto x \cdot \left(\color{blue}{\frac{y}{y - -1}} \cdot \frac{1}{\left(x + y\right) \cdot \left(x + y\right)}\right) \]
                            8. frac-timesN/A

                              \[\leadsto x \cdot \color{blue}{\frac{y \cdot 1}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                            9. *-rgt-identityN/A

                              \[\leadsto x \cdot \frac{\color{blue}{y}}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \]
                            10. lower-/.f64N/A

                              \[\leadsto x \cdot \color{blue}{\frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                            11. lower-*.f6475.4

                              \[\leadsto x \cdot \frac{y}{\color{blue}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]
                          5. Applied rewrites75.4%

                            \[\leadsto \color{blue}{x \cdot \frac{y}{\left(y - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \]

                          if -3.30000000000000019e-190 < 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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in x around 0

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                            2. lower-+.f6450.0

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                          6. Applied rewrites50.0%

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          7. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + \color{blue}{1}}}{y + x} \]
                            3. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}}{y + x} \]
                            4. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y + x} \]
                            5. lower--.f6450.0

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                          8. Applied rewrites50.0%

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                        6. Recombined 3 regimes into one program.
                        7. Add Preprocessing

                        Alternative 15: 86.7% accurate, 0.8× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.35 \cdot 10^{+50}:\\ \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot \frac{x}{y + x}\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-118}:\\ \;\;\;\;\frac{y}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 -3.35e+50)
                           (* (/ (/ y x) (+ x y)) (/ x (+ y x)))
                           (if (<= x -4.4e-118)
                             (* (/ y (* (- x -1.0) (* (+ x y) (+ x y)))) x)
                             (/ (/ x (- y -1.0)) (+ y x)))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -3.35e+50) {
                        		tmp = ((y / x) / (x + y)) * (x / (y + x));
                        	} else if (x <= -4.4e-118) {
                        		tmp = (y / ((x - -1.0) * ((x + y) * (x + y)))) * x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8) :: tmp
                            if (x <= (-3.35d+50)) then
                                tmp = ((y / x) / (x + y)) * (x / (y + x))
                            else if (x <= (-4.4d-118)) then
                                tmp = (y / ((x - (-1.0d0)) * ((x + y) * (x + y)))) * x
                            else
                                tmp = (x / (y - (-1.0d0))) / (y + x)
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -3.35e+50) {
                        		tmp = ((y / x) / (x + y)) * (x / (y + x));
                        	} else if (x <= -4.4e-118) {
                        		tmp = (y / ((x - -1.0) * ((x + y) * (x + y)))) * x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -3.35e+50:
                        		tmp = ((y / x) / (x + y)) * (x / (y + x))
                        	elif x <= -4.4e-118:
                        		tmp = (y / ((x - -1.0) * ((x + y) * (x + y)))) * x
                        	else:
                        		tmp = (x / (y - -1.0)) / (y + x)
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -3.35e+50)
                        		tmp = Float64(Float64(Float64(y / x) / Float64(x + y)) * Float64(x / Float64(y + x)));
                        	elseif (x <= -4.4e-118)
                        		tmp = Float64(Float64(y / Float64(Float64(x - -1.0) * Float64(Float64(x + y) * Float64(x + y)))) * x);
                        	else
                        		tmp = Float64(Float64(x / Float64(y - -1.0)) / Float64(y + x));
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -3.35e+50)
                        		tmp = ((y / x) / (x + y)) * (x / (y + x));
                        	elseif (x <= -4.4e-118)
                        		tmp = (y / ((x - -1.0) * ((x + y) * (x + y)))) * x;
                        	else
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -3.35e+50], N[(N[(N[(y / x), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -4.4e-118], N[(N[(y / N[(N[(x - -1.0), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -3.35 \cdot 10^{+50}:\\
                        \;\;\;\;\frac{\frac{y}{x}}{x + y} \cdot \frac{x}{y + x}\\
                        
                        \mathbf{elif}\;x \leq -4.4 \cdot 10^{-118}:\\
                        \;\;\;\;\frac{y}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x}{y - -1}}{y + x}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if x < -3.3499999999999999e50

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot \left(\left(x + y\right) + 1\right)} \]
                            4. associate-*l*N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)}} \]
                            5. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(x + y\right) \cdot \left(\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)\right)} \]
                            6. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{x + y} \cdot \frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            7. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \cdot \frac{x}{x + y}} \]
                            8. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) \cdot \left(\left(x + y\right) + 1\right)} \cdot \frac{x}{x + y}} \]
                          3. Applied rewrites94.1%

                            \[\leadsto \color{blue}{\frac{y}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)} \cdot \frac{x}{y + x}} \]
                          4. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{y}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)}} \cdot \frac{x}{y + x} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{\left(y - \left(-1 - x\right)\right) \cdot \left(y + x\right)}} \cdot \frac{x}{y + x} \]
                            3. associate-/r*N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{y + x}} \cdot \frac{x}{y + x} \]
                            4. lift-/.f64N/A

                              \[\leadsto \frac{\color{blue}{\frac{y}{y - \left(-1 - x\right)}}}{y + x} \cdot \frac{x}{y + x} \]
                            5. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{y + x}} \cdot \frac{x}{y + x} \]
                            6. +-commutativeN/A

                              \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{x + y}} \cdot \frac{x}{y + x} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{y - \left(-1 - x\right)}}{\color{blue}{x + y}} \cdot \frac{x}{y + x} \]
                            8. lower-/.f6499.8

                              \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{x + y}} \cdot \frac{x}{y + x} \]
                          5. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)}}{x + y}} \cdot \frac{x}{y + x} \]
                          6. Taylor expanded in x around inf

                            \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{y + x} \]
                          7. Step-by-step derivation
                            1. lower-/.f6438.9

                              \[\leadsto \frac{\frac{y}{\color{blue}{x}}}{x + y} \cdot \frac{x}{y + x} \]
                          8. Applied rewrites38.9%

                            \[\leadsto \frac{\color{blue}{\frac{y}{x}}}{x + y} \cdot \frac{x}{y + x} \]

                          if -3.3499999999999999e50 < x < -4.39999999999999967e-118

                          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 0

                            \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(1 + x\right)}} \]
                          3. Step-by-step derivation
                            1. lower-+.f6459.4

                              \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + \color{blue}{x}\right)} \]
                          4. Applied rewrites59.4%

                            \[\leadsto \frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \color{blue}{\left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)} \]
                            3. associate-/l*N/A

                              \[\leadsto \color{blue}{x \cdot \frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \]
                            4. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)} \cdot x} \]
                            5. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)} \cdot x} \]
                            6. lower-/.f6471.9

                              \[\leadsto \color{blue}{\frac{y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \cdot x \]
                            7. lift-*.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + x\right)}} \cdot x \]
                            8. *-commutativeN/A

                              \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \cdot x \]
                            9. lower-*.f6471.9

                              \[\leadsto \frac{y}{\color{blue}{\left(1 + x\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)}} \cdot x \]
                            10. lift-+.f64N/A

                              \[\leadsto \frac{y}{\left(1 + \color{blue}{x}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x \]
                            11. +-commutativeN/A

                              \[\leadsto \frac{y}{\left(x + \color{blue}{1}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x \]
                            12. add-flip-revN/A

                              \[\leadsto \frac{y}{\left(x - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x \]
                            13. metadata-evalN/A

                              \[\leadsto \frac{y}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x \]
                            14. lower--.f6471.9

                              \[\leadsto \frac{y}{\left(x - \color{blue}{-1}\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x \]
                          6. Applied rewrites71.9%

                            \[\leadsto \color{blue}{\frac{y}{\left(x - -1\right) \cdot \left(\left(x + y\right) \cdot \left(x + y\right)\right)} \cdot x} \]

                          if -4.39999999999999967e-118 < 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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in x around 0

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                            2. lower-+.f6450.0

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                          6. Applied rewrites50.0%

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          7. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + \color{blue}{1}}}{y + x} \]
                            3. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}}{y + x} \]
                            4. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y + x} \]
                            5. lower--.f6450.0

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                          8. Applied rewrites50.0%

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                        3. Recombined 3 regimes into one program.
                        4. Add Preprocessing

                        Alternative 16: 82.9% accurate, 1.4× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 -7.8e-106)
                           (/ (/ y (- x -1.0)) (+ y x))
                           (/ (/ x (- y -1.0)) (+ y x))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / (y + x);
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8) :: tmp
                            if (x <= (-7.8d-106)) then
                                tmp = (y / (x - (-1.0d0))) / (y + x)
                            else
                                tmp = (x / (y - (-1.0d0))) / (y + x)
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / (y + x);
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -7.8e-106:
                        		tmp = (y / (x - -1.0)) / (y + x)
                        	else:
                        		tmp = (x / (y - -1.0)) / (y + x)
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -7.8e-106)
                        		tmp = Float64(Float64(y / Float64(x - -1.0)) / Float64(y + x));
                        	else
                        		tmp = Float64(Float64(x / Float64(y - -1.0)) / Float64(y + x));
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -7.8e-106)
                        		tmp = (y / (x - -1.0)) / (y + x);
                        	else
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -7.8e-106], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\
                        \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x}{y - -1}}{y + x}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -7.80000000000000019e-106

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{\frac{y}{\color{blue}{1 + x}}}{y + x} \]
                            2. lower-+.f6451.6

                              \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
                          6. Applied rewrites51.6%

                            \[\leadsto \frac{\color{blue}{\frac{y}{1 + x}}}{y + x} \]
                          7. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{1 + \color{blue}{x}}}{y + x} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\frac{y}{x + \color{blue}{1}}}{y + x} \]
                            3. metadata-evalN/A

                              \[\leadsto \frac{\frac{y}{x + \left(\mathsf{neg}\left(-1\right)\right)}}{y + x} \]
                            4. sub-flipN/A

                              \[\leadsto \frac{\frac{y}{x - \color{blue}{-1}}}{y + x} \]
                            5. lift--.f6451.6

                              \[\leadsto \frac{\frac{y}{x - \color{blue}{-1}}}{y + x} \]
                          8. Applied rewrites51.6%

                            \[\leadsto \frac{\color{blue}{\frac{y}{x - -1}}}{y + x} \]

                          if -7.80000000000000019e-106 < 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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in x around 0

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                            2. lower-+.f6450.0

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                          6. Applied rewrites50.0%

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          7. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + \color{blue}{1}}}{y + x} \]
                            3. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}}{y + x} \]
                            4. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y + x} \]
                            5. lower--.f6450.0

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                          8. Applied rewrites50.0%

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 17: 82.8% accurate, 1.4× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 -7.8e-106) (/ (/ y (- x -1.0)) x) (/ (/ x (- y -1.0)) (+ y x))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(x, y)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8) :: tmp
                            if (x <= (-7.8d-106)) then
                                tmp = (y / (x - (-1.0d0))) / x
                            else
                                tmp = (x / (y - (-1.0d0))) / (y + x)
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -7.8e-106:
                        		tmp = (y / (x - -1.0)) / x
                        	else:
                        		tmp = (x / (y - -1.0)) / (y + x)
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -7.8e-106)
                        		tmp = Float64(Float64(y / Float64(x - -1.0)) / x);
                        	else
                        		tmp = Float64(Float64(x / Float64(y - -1.0)) / Float64(y + x));
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -7.8e-106)
                        		tmp = (y / (x - -1.0)) / x;
                        	else
                        		tmp = (x / (y - -1.0)) / (y + x);
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -7.8e-106], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\
                        \;\;\;\;\frac{\frac{y}{x - -1}}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x}{y - -1}}{y + x}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -7.80000000000000019e-106

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. lower-+.f6449.9

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                          6. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          7. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                            4. associate-/r*N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{\color{blue}{x}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{\color{blue}{x}} \]
                            6. lower-/.f6451.2

                              \[\leadsto \frac{\frac{y}{1 + x}}{x} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{x} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\frac{y}{x + 1}}{x} \]
                            9. add-flip-revN/A

                              \[\leadsto \frac{\frac{y}{x - \left(\mathsf{neg}\left(1\right)\right)}}{x} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{\frac{y}{x - -1}}{x} \]
                            11. lower--.f6451.2

                              \[\leadsto \frac{\frac{y}{x - -1}}{x} \]
                          8. Applied rewrites51.2%

                            \[\leadsto \frac{\frac{y}{x - -1}}{\color{blue}{x}} \]

                          if -7.80000000000000019e-106 < 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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in x around 0

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{\color{blue}{1 + y}}}{y + x} \]
                            2. lower-+.f6450.0

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                          6. Applied rewrites50.0%

                            \[\leadsto \frac{\color{blue}{\frac{x}{1 + y}}}{y + x} \]
                          7. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + \color{blue}{y}}}{y + x} \]
                            2. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + \color{blue}{1}}}{y + x} \]
                            3. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}}}{y + x} \]
                            4. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y + x} \]
                            5. lower--.f6450.0

                              \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                          8. Applied rewrites50.0%

                            \[\leadsto \frac{\frac{x}{y - \color{blue}{-1}}}{y + x} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 18: 82.7% accurate, 1.7× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 -7.8e-106) (/ (/ y (- x -1.0)) x) (/ (/ x (- y -1.0)) y)))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / 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 <= (-7.8d-106)) then
                                tmp = (y / (x - (-1.0d0))) / x
                            else
                                tmp = (x / (y - (-1.0d0))) / y
                            end if
                            code = tmp
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = (y / (x - -1.0)) / x;
                        	} else {
                        		tmp = (x / (y - -1.0)) / y;
                        	}
                        	return tmp;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	tmp = 0
                        	if x <= -7.8e-106:
                        		tmp = (y / (x - -1.0)) / x
                        	else:
                        		tmp = (x / (y - -1.0)) / y
                        	return tmp
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -7.8e-106)
                        		tmp = Float64(Float64(y / Float64(x - -1.0)) / x);
                        	else
                        		tmp = Float64(Float64(x / Float64(y - -1.0)) / y);
                        	end
                        	return tmp
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp_2 = code(x, y)
                        	tmp = 0.0;
                        	if (x <= -7.8e-106)
                        		tmp = (y / (x - -1.0)) / x;
                        	else
                        		tmp = (x / (y - -1.0)) / 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, -7.8e-106], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\
                        \;\;\;\;\frac{\frac{y}{x - -1}}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x}{y - -1}}{y}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -7.80000000000000019e-106

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. lower-+.f6449.9

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                          6. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          7. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{y}{\left(1 + x\right) \cdot \color{blue}{x}} \]
                            4. associate-/r*N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{\color{blue}{x}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{\color{blue}{x}} \]
                            6. lower-/.f6451.2

                              \[\leadsto \frac{\frac{y}{1 + x}}{x} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{y}{1 + x}}{x} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\frac{y}{x + 1}}{x} \]
                            9. add-flip-revN/A

                              \[\leadsto \frac{\frac{y}{x - \left(\mathsf{neg}\left(1\right)\right)}}{x} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{\frac{y}{x - -1}}{x} \]
                            11. lower--.f6451.2

                              \[\leadsto \frac{\frac{y}{x - -1}}{x} \]
                          8. Applied rewrites51.2%

                            \[\leadsto \frac{\frac{y}{x - -1}}{\color{blue}{x}} \]

                          if -7.80000000000000019e-106 < 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 x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. lower-+.f6448.3

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                          4. Applied rewrites48.3%

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          5. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                            4. associate-/r*N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
                            6. lower-/.f6449.5

                              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + 1}}{y} \]
                            9. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \left(\mathsf{neg}\left(1\right)\right)}}{y} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
                            11. lower--.f6449.5

                              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
                          6. Applied rewrites49.5%

                            \[\leadsto \frac{\frac{x}{y - -1}}{\color{blue}{y}} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 19: 80.8% accurate, 1.7× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y - -1}}{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 -7.8e-106) (/ y (fma x x x)) (/ (/ x (- y -1.0)) y)))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = y / fma(x, x, x);
                        	} else {
                        		tmp = (x / (y - -1.0)) / y;
                        	}
                        	return tmp;
                        }
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -7.8e-106)
                        		tmp = Float64(y / fma(x, x, x));
                        	else
                        		tmp = Float64(Float64(x / Float64(y - -1.0)) / y);
                        	end
                        	return tmp
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -7.8e-106], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\
                        \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{x}{y - -1}}{y}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -7.80000000000000019e-106

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. lower-+.f6449.9

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                          6. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          7. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            2. lift-+.f64N/A

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                            3. +-commutativeN/A

                              \[\leadsto \frac{y}{x \cdot \left(x + \color{blue}{1}\right)} \]
                            4. distribute-rgt-inN/A

                              \[\leadsto \frac{y}{x \cdot x + \color{blue}{1 \cdot x}} \]
                            5. *-lft-identityN/A

                              \[\leadsto \frac{y}{x \cdot x + x} \]
                            6. lower-fma.f6449.9

                              \[\leadsto \frac{y}{\mathsf{fma}\left(x, \color{blue}{x}, x\right)} \]
                          8. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(x, x, x\right)}} \]

                          if -7.80000000000000019e-106 < 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 x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. lower-+.f6448.3

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                          4. Applied rewrites48.3%

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          5. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. *-commutativeN/A

                              \[\leadsto \frac{x}{\left(1 + y\right) \cdot \color{blue}{y}} \]
                            4. associate-/r*N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
                            5. lower-/.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{\color{blue}{y}} \]
                            6. lower-/.f6449.5

                              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
                            7. lift-+.f64N/A

                              \[\leadsto \frac{\frac{x}{1 + y}}{y} \]
                            8. +-commutativeN/A

                              \[\leadsto \frac{\frac{x}{y + 1}}{y} \]
                            9. add-flip-revN/A

                              \[\leadsto \frac{\frac{x}{y - \left(\mathsf{neg}\left(1\right)\right)}}{y} \]
                            10. metadata-evalN/A

                              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
                            11. lower--.f6449.5

                              \[\leadsto \frac{\frac{x}{y - -1}}{y} \]
                          6. Applied rewrites49.5%

                            \[\leadsto \frac{\frac{x}{y - -1}}{\color{blue}{y}} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 20: 79.5% accurate, 1.8× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\ \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\ \end{array} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y)
                         :precision binary64
                         (if (<= x -7.8e-106) (/ y (fma x x x)) (/ x (fma y y y))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (x <= -7.8e-106) {
                        		tmp = y / fma(x, x, x);
                        	} else {
                        		tmp = x / fma(y, y, y);
                        	}
                        	return tmp;
                        }
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (x <= -7.8e-106)
                        		tmp = Float64(y / fma(x, x, x));
                        	else
                        		tmp = Float64(x / fma(y, y, y));
                        	end
                        	return tmp
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[x, -7.8e-106], N[(y / N[(x * x + x), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -7.8 \cdot 10^{-106}:\\
                        \;\;\;\;\frac{y}{\mathsf{fma}\left(x, x, x\right)}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -7.80000000000000019e-106

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. lower-+.f6449.9

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                          6. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          7. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            2. lift-+.f64N/A

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                            3. +-commutativeN/A

                              \[\leadsto \frac{y}{x \cdot \left(x + \color{blue}{1}\right)} \]
                            4. distribute-rgt-inN/A

                              \[\leadsto \frac{y}{x \cdot x + \color{blue}{1 \cdot x}} \]
                            5. *-lft-identityN/A

                              \[\leadsto \frac{y}{x \cdot x + x} \]
                            6. lower-fma.f6449.9

                              \[\leadsto \frac{y}{\mathsf{fma}\left(x, \color{blue}{x}, x\right)} \]
                          8. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{\mathsf{fma}\left(x, x, x\right)}} \]

                          if -7.80000000000000019e-106 < 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 x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. lower-+.f6448.3

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                          4. Applied rewrites48.3%

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          5. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            2. lift-+.f64N/A

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                            3. +-commutativeN/A

                              \[\leadsto \frac{x}{y \cdot \left(y + \color{blue}{1}\right)} \]
                            4. distribute-rgt-inN/A

                              \[\leadsto \frac{x}{y \cdot y + \color{blue}{1 \cdot y}} \]
                            5. *-lft-identityN/A

                              \[\leadsto \frac{x}{y \cdot y + y} \]
                            6. lower-fma.f6448.3

                              \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{y}, y\right)} \]
                          6. Applied rewrites48.3%

                            \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{y}, y\right)} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 21: 64.6% accurate, 1.8× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.32 \cdot 10^{-210}:\\ \;\;\;\;\frac{y}{x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\ \end{array} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y)
                         :precision binary64
                         (if (<= y 1.32e-210) (/ y x) (/ x (fma y y y))))
                        assert(x < y);
                        double code(double x, double y) {
                        	double tmp;
                        	if (y <= 1.32e-210) {
                        		tmp = y / x;
                        	} else {
                        		tmp = x / fma(y, y, y);
                        	}
                        	return tmp;
                        }
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	tmp = 0.0
                        	if (y <= 1.32e-210)
                        		tmp = Float64(y / x);
                        	else
                        		tmp = Float64(x / fma(y, y, y));
                        	end
                        	return tmp
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := If[LessEqual[y, 1.32e-210], N[(y / x), $MachinePrecision], N[(x / N[(y * y + y), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;y \leq 1.32 \cdot 10^{-210}:\\
                        \;\;\;\;\frac{y}{x}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{x}{\mathsf{fma}\left(y, y, y\right)}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if y < 1.3200000000000001e-210

                          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. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            2. lift-*.f64N/A

                              \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                            3. lift-*.f64N/A

                              \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                            4. times-fracN/A

                              \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                            5. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            6. lift-*.f64N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                            7. associate-/r*N/A

                              \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                            8. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                            9. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          3. Applied rewrites99.8%

                            \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                          4. Taylor expanded in y around 0

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          5. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                            3. lower-+.f6449.9

                              \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                          6. Applied rewrites49.9%

                            \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                          7. Taylor expanded in x around 0

                            \[\leadsto \frac{y}{\color{blue}{x}} \]
                          8. Step-by-step derivation
                            1. lower-/.f6426.7

                              \[\leadsto \frac{y}{x} \]
                          9. Applied rewrites26.7%

                            \[\leadsto \frac{y}{\color{blue}{x}} \]

                          if 1.3200000000000001e-210 < y

                          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 x around 0

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{x}{\color{blue}{y \cdot \left(1 + y\right)}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            3. lower-+.f6448.3

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                          4. Applied rewrites48.3%

                            \[\leadsto \color{blue}{\frac{x}{y \cdot \left(1 + y\right)}} \]
                          5. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto \frac{x}{y \cdot \color{blue}{\left(1 + y\right)}} \]
                            2. lift-+.f64N/A

                              \[\leadsto \frac{x}{y \cdot \left(1 + \color{blue}{y}\right)} \]
                            3. +-commutativeN/A

                              \[\leadsto \frac{x}{y \cdot \left(y + \color{blue}{1}\right)} \]
                            4. distribute-rgt-inN/A

                              \[\leadsto \frac{x}{y \cdot y + \color{blue}{1 \cdot y}} \]
                            5. *-lft-identityN/A

                              \[\leadsto \frac{x}{y \cdot y + y} \]
                            6. lower-fma.f6448.3

                              \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{y}, y\right)} \]
                          6. Applied rewrites48.3%

                            \[\leadsto \frac{x}{\mathsf{fma}\left(y, \color{blue}{y}, y\right)} \]
                        3. Recombined 2 regimes into one program.
                        4. Add Preprocessing

                        Alternative 22: 26.7% accurate, 5.5× speedup?

                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{y}{x} \end{array} \]
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        (FPCore (x y) :precision binary64 (/ y x))
                        assert(x < y);
                        double code(double x, double y) {
                        	return 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 = y / x
                        end function
                        
                        assert x < y;
                        public static double code(double x, double y) {
                        	return y / x;
                        }
                        
                        [x, y] = sort([x, y])
                        def code(x, y):
                        	return y / x
                        
                        x, y = sort([x, y])
                        function code(x, y)
                        	return Float64(y / x)
                        end
                        
                        x, y = num2cell(sort([x, y])){:}
                        function tmp = code(x, y)
                        	tmp = y / x;
                        end
                        
                        NOTE: x and y should be sorted in increasing order before calling this function.
                        code[x_, y_] := N[(y / x), $MachinePrecision]
                        
                        \begin{array}{l}
                        [x, y] = \mathsf{sort}([x, y])\\
                        \\
                        \frac{y}{x}
                        \end{array}
                        
                        Derivation
                        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. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \color{blue}{\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          2. lift-*.f64N/A

                            \[\leadsto \frac{\color{blue}{x \cdot y}}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
                          3. lift-*.f64N/A

                            \[\leadsto \frac{x \cdot y}{\color{blue}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}} \]
                          4. times-fracN/A

                            \[\leadsto \color{blue}{\frac{x}{\left(x + y\right) \cdot \left(x + y\right)} \cdot \frac{y}{\left(x + y\right) + 1}} \]
                          5. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          6. lift-*.f64N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{\color{blue}{\left(x + y\right) \cdot \left(x + y\right)}} \]
                          7. associate-/r*N/A

                            \[\leadsto \frac{y}{\left(x + y\right) + 1} \cdot \color{blue}{\frac{\frac{x}{x + y}}{x + y}} \]
                          8. associate-*r/N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                          9. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\frac{y}{\left(x + y\right) + 1} \cdot \frac{x}{x + y}}{x + y}} \]
                        3. Applied rewrites99.8%

                          \[\leadsto \color{blue}{\frac{\frac{y}{y - \left(-1 - x\right)} \cdot \frac{x}{y + x}}{y + x}} \]
                        4. Taylor expanded in y around 0

                          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                        5. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{y}{\color{blue}{x \cdot \left(1 + x\right)}} \]
                          2. lower-*.f64N/A

                            \[\leadsto \frac{y}{x \cdot \color{blue}{\left(1 + x\right)}} \]
                          3. lower-+.f6449.9

                            \[\leadsto \frac{y}{x \cdot \left(1 + \color{blue}{x}\right)} \]
                        6. Applied rewrites49.9%

                          \[\leadsto \color{blue}{\frac{y}{x \cdot \left(1 + x\right)}} \]
                        7. Taylor expanded in x around 0

                          \[\leadsto \frac{y}{\color{blue}{x}} \]
                        8. Step-by-step derivation
                          1. lower-/.f6426.7

                            \[\leadsto \frac{y}{x} \]
                        9. Applied rewrites26.7%

                          \[\leadsto \frac{y}{\color{blue}{x}} \]
                        10. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2025155 
                        (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))))