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

Percentage Accurate: 69.6% → 99.8%
Time: 5.4s
Alternatives: 17
Speedup: 1.6×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 69.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, 0.8× speedup?

\[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \frac{\frac{y}{\left(y + x\right) - -1} \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 x) -1.0)) (/ x (+ y x))) (+ y x)))
assert(x < y);
double code(double x, double y) {
	return ((y / ((y + x) - -1.0)) * (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 + x) - (-1.0d0))) * (x / (y + x))) / (y + x)
end function
assert x < y;
public static double code(double x, double y) {
	return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x);
}
[x, y] = sort([x, y])
def code(x, y):
	return ((y / ((y + x) - -1.0)) * (x / (y + x))) / (y + x)
x, y = sort([x, y])
function code(x, y)
	return Float64(Float64(Float64(y / Float64(Float64(y + x) - -1.0)) * Float64(x / Float64(y + x))) / Float64(y + x))
end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y)
	tmp = ((y / ((y + x) - -1.0)) * (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[(N[(y + x), $MachinePrecision] - -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])\\
\\
\frac{\frac{y}{\left(y + x\right) - -1} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Derivation
  1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
    17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.2% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-x, \frac{\mathsf{fma}\left(2, x, 1\right)}{y}, x\right)}{y}}{y + x}\\


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

    1. Initial program 73.4%

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

        \[\leadsto \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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
      17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
      25. metadata-eval96.6

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

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

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

    if 9.50000000000000019e111 < y

    1. Initial program 50.5%

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

        \[\leadsto \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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
      17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
      25. metadata-eval78.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 92.7% accurate, 0.7× speedup?

    \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{-9}:\\ \;\;\;\;1 \cdot \frac{y}{\left(\left(y + x\right) - -1\right) \cdot \left(y + x\right)}\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{-63}:\\ \;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y - -1\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{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 -2.4e-9)
       (* 1.0 (/ y (* (- (+ y x) -1.0) (+ y x))))
       (if (<= x 3.8e-63)
         (* (/ y (+ y x)) (/ x (* (- y -1.0) (+ y x))))
         (/ (* 1.0 (/ x (+ y x))) (+ y x)))))
    assert(x < y);
    double code(double x, double y) {
    	double tmp;
    	if (x <= -2.4e-9) {
    		tmp = 1.0 * (y / (((y + x) - -1.0) * (y + x)));
    	} else if (x <= 3.8e-63) {
    		tmp = (y / (y + x)) * (x / ((y - -1.0) * (y + x)));
    	} else {
    		tmp = (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 <= (-2.4d-9)) then
            tmp = 1.0d0 * (y / (((y + x) - (-1.0d0)) * (y + x)))
        else if (x <= 3.8d-63) then
            tmp = (y / (y + x)) * (x / ((y - (-1.0d0)) * (y + x)))
        else
            tmp = (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 <= -2.4e-9) {
    		tmp = 1.0 * (y / (((y + x) - -1.0) * (y + x)));
    	} else if (x <= 3.8e-63) {
    		tmp = (y / (y + x)) * (x / ((y - -1.0) * (y + x)));
    	} else {
    		tmp = (1.0 * (x / (y + x))) / (y + x);
    	}
    	return tmp;
    }
    
    [x, y] = sort([x, y])
    def code(x, y):
    	tmp = 0
    	if x <= -2.4e-9:
    		tmp = 1.0 * (y / (((y + x) - -1.0) * (y + x)))
    	elif x <= 3.8e-63:
    		tmp = (y / (y + x)) * (x / ((y - -1.0) * (y + x)))
    	else:
    		tmp = (1.0 * (x / (y + x))) / (y + x)
    	return tmp
    
    x, y = sort([x, y])
    function code(x, y)
    	tmp = 0.0
    	if (x <= -2.4e-9)
    		tmp = Float64(1.0 * Float64(y / Float64(Float64(Float64(y + x) - -1.0) * Float64(y + x))));
    	elseif (x <= 3.8e-63)
    		tmp = Float64(Float64(y / Float64(y + x)) * Float64(x / Float64(Float64(y - -1.0) * Float64(y + x))));
    	else
    		tmp = Float64(Float64(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 <= -2.4e-9)
    		tmp = 1.0 * (y / (((y + x) - -1.0) * (y + x)));
    	elseif (x <= 3.8e-63)
    		tmp = (y / (y + x)) * (x / ((y - -1.0) * (y + x)));
    	else
    		tmp = (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, -2.4e-9], N[(1.0 * N[(y / N[(N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-63], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(x / N[(N[(y - -1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 * 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 -2.4 \cdot 10^{-9}:\\
    \;\;\;\;1 \cdot \frac{y}{\left(\left(y + x\right) - -1\right) \cdot \left(y + x\right)}\\
    
    \mathbf{elif}\;x \leq 3.8 \cdot 10^{-63}:\\
    \;\;\;\;\frac{y}{y + x} \cdot \frac{x}{\left(y - -1\right) \cdot \left(y + x\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 \cdot \frac{x}{y + x}}{y + x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -2.4e-9

      1. Initial program 67.1%

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
        17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
        25. metadata-eval91.8

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

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

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

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

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

        if -2.4e-9 < x < 3.80000000000000017e-63

        1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.80000000000000017e-63 < x

          1. Initial program 61.9%

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
            17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
            25. metadata-eval82.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 89.1% accurate, 0.8× speedup?

          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.2 \cdot 10^{-149}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{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 (<= y 4.2e-149)
             (/ (/ y (- x -1.0)) (+ y x))
             (if (<= y 8.5e+93)
               (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0)))
               (* (/ x (+ y x)) (/ 1.0 y)))))
          assert(x < y);
          double code(double x, double y) {
          	double tmp;
          	if (y <= 4.2e-149) {
          		tmp = (y / (x - -1.0)) / (y + x);
          	} else if (y <= 8.5e+93) {
          		tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
          	} else {
          		tmp = (x / (y + x)) * (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 (y <= 4.2d-149) then
                  tmp = (y / (x - (-1.0d0))) / (y + x)
              else if (y <= 8.5d+93) then
                  tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
              else
                  tmp = (x / (y + x)) * (1.0d0 / y)
              end if
              code = tmp
          end function
          
          assert x < y;
          public static double code(double x, double y) {
          	double tmp;
          	if (y <= 4.2e-149) {
          		tmp = (y / (x - -1.0)) / (y + x);
          	} else if (y <= 8.5e+93) {
          		tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
          	} else {
          		tmp = (x / (y + x)) * (1.0 / y);
          	}
          	return tmp;
          }
          
          [x, y] = sort([x, y])
          def code(x, y):
          	tmp = 0
          	if y <= 4.2e-149:
          		tmp = (y / (x - -1.0)) / (y + x)
          	elif y <= 8.5e+93:
          		tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
          	else:
          		tmp = (x / (y + x)) * (1.0 / y)
          	return tmp
          
          x, y = sort([x, y])
          function code(x, y)
          	tmp = 0.0
          	if (y <= 4.2e-149)
          		tmp = Float64(Float64(y / Float64(x - -1.0)) / Float64(y + x));
          	elseif (y <= 8.5e+93)
          		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0)));
          	else
          		tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y));
          	end
          	return tmp
          end
          
          x, y = num2cell(sort([x, y])){:}
          function tmp_2 = code(x, y)
          	tmp = 0.0;
          	if (y <= 4.2e-149)
          		tmp = (y / (x - -1.0)) / (y + x);
          	elseif (y <= 8.5e+93)
          		tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
          	else
          		tmp = (x / (y + x)) * (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[y, 4.2e-149], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+93], 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], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          [x, y] = \mathsf{sort}([x, y])\\
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq 4.2 \cdot 10^{-149}:\\
          \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\
          
          \mathbf{elif}\;y \leq 8.5 \cdot 10^{+93}:\\
          \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < 4.20000000000000022e-149

            1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
              17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
              25. metadata-eval95.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 4.20000000000000022e-149 < y < 8.5000000000000005e93

              1. Initial program 90.1%

                \[\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)} \]
              2. Add Preprocessing

              if 8.5000000000000005e93 < y

              1. Initial program 48.7%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                  \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                25. metadata-eval79.5

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

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

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

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

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

              Alternative 5: 95.4% accurate, 0.8× speedup?

              \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} t_0 := \frac{x}{y + x}\\ \mathbf{if}\;y \leq 3.8 \cdot 10^{+130}:\\ \;\;\;\;t\_0 \cdot \frac{y}{\left(\left(y + x\right) - -1\right) \cdot \left(y + x\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \frac{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
               (let* ((t_0 (/ x (+ y x))))
                 (if (<= y 3.8e+130)
                   (* t_0 (/ y (* (- (+ y x) -1.0) (+ y x))))
                   (* t_0 (/ 1.0 y)))))
              assert(x < y);
              double code(double x, double y) {
              	double t_0 = x / (y + x);
              	double tmp;
              	if (y <= 3.8e+130) {
              		tmp = t_0 * (y / (((y + x) - -1.0) * (y + x)));
              	} else {
              		tmp = t_0 * (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) :: t_0
                  real(8) :: tmp
                  t_0 = x / (y + x)
                  if (y <= 3.8d+130) then
                      tmp = t_0 * (y / (((y + x) - (-1.0d0)) * (y + x)))
                  else
                      tmp = t_0 * (1.0d0 / 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 <= 3.8e+130) {
              		tmp = t_0 * (y / (((y + x) - -1.0) * (y + x)));
              	} else {
              		tmp = t_0 * (1.0 / y);
              	}
              	return tmp;
              }
              
              [x, y] = sort([x, y])
              def code(x, y):
              	t_0 = x / (y + x)
              	tmp = 0
              	if y <= 3.8e+130:
              		tmp = t_0 * (y / (((y + x) - -1.0) * (y + x)))
              	else:
              		tmp = t_0 * (1.0 / y)
              	return tmp
              
              x, y = sort([x, y])
              function code(x, y)
              	t_0 = Float64(x / Float64(y + x))
              	tmp = 0.0
              	if (y <= 3.8e+130)
              		tmp = Float64(t_0 * Float64(y / Float64(Float64(Float64(y + x) - -1.0) * Float64(y + x))));
              	else
              		tmp = Float64(t_0 * Float64(1.0 / 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 <= 3.8e+130)
              		tmp = t_0 * (y / (((y + x) - -1.0) * (y + x)));
              	else
              		tmp = t_0 * (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_] := Block[{t$95$0 = N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.8e+130], N[(t$95$0 * N[(y / N[(N[(N[(y + x), $MachinePrecision] - -1.0), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              [x, y] = \mathsf{sort}([x, y])\\
              \\
              \begin{array}{l}
              t_0 := \frac{x}{y + x}\\
              \mathbf{if}\;y \leq 3.8 \cdot 10^{+130}:\\
              \;\;\;\;t\_0 \cdot \frac{y}{\left(\left(y + x\right) - -1\right) \cdot \left(y + x\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0 \cdot \frac{1}{y}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < 3.8000000000000002e130

                1. Initial program 73.2%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                  17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                    \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                  25. metadata-eval96.2

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

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

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

                if 3.8000000000000002e130 < y

                1. Initial program 50.4%

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

                    \[\leadsto \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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                  17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                    \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                  25. metadata-eval79.8

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

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

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

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

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

                Alternative 6: 99.8% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                  17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 7: 85.7% accurate, 0.8× speedup?

                \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 4.6 \cdot 10^{-129}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\ \mathbf{elif}\;y \leq 9.4 \cdot 10^{+86}:\\ \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + y\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{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 (<= y 4.6e-129)
                   (/ (/ y (- x -1.0)) (+ y x))
                   (if (<= y 9.4e+86)
                     (/ (* x y) (* (* (+ x y) (+ x y)) (+ 1.0 y)))
                     (* (/ x (+ y x)) (/ 1.0 y)))))
                assert(x < y);
                double code(double x, double y) {
                	double tmp;
                	if (y <= 4.6e-129) {
                		tmp = (y / (x - -1.0)) / (y + x);
                	} else if (y <= 9.4e+86) {
                		tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y));
                	} else {
                		tmp = (x / (y + x)) * (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 (y <= 4.6d-129) then
                        tmp = (y / (x - (-1.0d0))) / (y + x)
                    else if (y <= 9.4d+86) then
                        tmp = (x * y) / (((x + y) * (x + y)) * (1.0d0 + y))
                    else
                        tmp = (x / (y + x)) * (1.0d0 / y)
                    end if
                    code = tmp
                end function
                
                assert x < y;
                public static double code(double x, double y) {
                	double tmp;
                	if (y <= 4.6e-129) {
                		tmp = (y / (x - -1.0)) / (y + x);
                	} else if (y <= 9.4e+86) {
                		tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y));
                	} else {
                		tmp = (x / (y + x)) * (1.0 / y);
                	}
                	return tmp;
                }
                
                [x, y] = sort([x, y])
                def code(x, y):
                	tmp = 0
                	if y <= 4.6e-129:
                		tmp = (y / (x - -1.0)) / (y + x)
                	elif y <= 9.4e+86:
                		tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y))
                	else:
                		tmp = (x / (y + x)) * (1.0 / y)
                	return tmp
                
                x, y = sort([x, y])
                function code(x, y)
                	tmp = 0.0
                	if (y <= 4.6e-129)
                		tmp = Float64(Float64(y / Float64(x - -1.0)) / Float64(y + x));
                	elseif (y <= 9.4e+86)
                		tmp = Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(1.0 + y)));
                	else
                		tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y));
                	end
                	return tmp
                end
                
                x, y = num2cell(sort([x, y])){:}
                function tmp_2 = code(x, y)
                	tmp = 0.0;
                	if (y <= 4.6e-129)
                		tmp = (y / (x - -1.0)) / (y + x);
                	elseif (y <= 9.4e+86)
                		tmp = (x * y) / (((x + y) * (x + y)) * (1.0 + y));
                	else
                		tmp = (x / (y + x)) * (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[y, 4.6e-129], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.4e+86], N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                [x, y] = \mathsf{sort}([x, y])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq 4.6 \cdot 10^{-129}:\\
                \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\
                
                \mathbf{elif}\;y \leq 9.4 \cdot 10^{+86}:\\
                \;\;\;\;\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(1 + y\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if y < 4.5999999999999999e-129

                  1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                    17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                    25. metadata-eval95.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 4.5999999999999999e-129 < y < 9.4000000000000004e86

                    1. Initial program 89.2%

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

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

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

                      if 9.4000000000000004e86 < y

                      1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                        17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                        25. metadata-eval79.9

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

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

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

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

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

                      Alternative 8: 82.9% accurate, 1.0× speedup?

                      \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-87}:\\ \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{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 (<= y 1.5e-87)
                         (/ (/ y (- x -1.0)) (+ y x))
                         (* (/ x (+ y x)) (/ 1.0 (+ 1.0 y)))))
                      assert(x < y);
                      double code(double x, double y) {
                      	double tmp;
                      	if (y <= 1.5e-87) {
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	} else {
                      		tmp = (x / (y + x)) * (1.0 / (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 (y <= 1.5d-87) then
                              tmp = (y / (x - (-1.0d0))) / (y + x)
                          else
                              tmp = (x / (y + x)) * (1.0d0 / (1.0d0 + y))
                          end if
                          code = tmp
                      end function
                      
                      assert x < y;
                      public static double code(double x, double y) {
                      	double tmp;
                      	if (y <= 1.5e-87) {
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	} else {
                      		tmp = (x / (y + x)) * (1.0 / (1.0 + y));
                      	}
                      	return tmp;
                      }
                      
                      [x, y] = sort([x, y])
                      def code(x, y):
                      	tmp = 0
                      	if y <= 1.5e-87:
                      		tmp = (y / (x - -1.0)) / (y + x)
                      	else:
                      		tmp = (x / (y + x)) * (1.0 / (1.0 + y))
                      	return tmp
                      
                      x, y = sort([x, y])
                      function code(x, y)
                      	tmp = 0.0
                      	if (y <= 1.5e-87)
                      		tmp = Float64(Float64(y / Float64(x - -1.0)) / Float64(y + x));
                      	else
                      		tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / Float64(1.0 + y)));
                      	end
                      	return tmp
                      end
                      
                      x, y = num2cell(sort([x, y])){:}
                      function tmp_2 = code(x, y)
                      	tmp = 0.0;
                      	if (y <= 1.5e-87)
                      		tmp = (y / (x - -1.0)) / (y + x);
                      	else
                      		tmp = (x / (y + x)) * (1.0 / (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[y, 1.5e-87], N[(N[(y / N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      [x, y] = \mathsf{sort}([x, y])\\
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;y \leq 1.5 \cdot 10^{-87}:\\
                      \;\;\;\;\frac{\frac{y}{x - -1}}{y + x}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{x}{y + x} \cdot \frac{1}{1 + y}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y < 1.50000000000000008e-87

                        1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                          17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                            \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                          25. metadata-eval96.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 1.50000000000000008e-87 < y

                          1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                            17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                            25. metadata-eval87.0

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

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

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

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

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

                          Alternative 9: 81.2% accurate, 1.1× speedup?

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

                            1. Initial program 71.8%

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

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

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

                              if 1.50000000000000008e-87 < y < 5.00000000000000018e61

                              1. Initial program 88.4%

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

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

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

                                if 5.00000000000000018e61 < y

                                1. Initial program 51.5%

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

                                  \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites76.3%

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

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

                                  Alternative 10: 82.9% accurate, 1.1× speedup?

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

                                    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                                      17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                                        \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                                      25. metadata-eval96.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 1.50000000000000008e-87 < y

                                      1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                                        17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                                          \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                                        25. metadata-eval87.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 11: 81.3% accurate, 1.1× speedup?

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

                                        1. Initial program 71.8%

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

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

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

                                          if 1.50000000000000008e-87 < y

                                          1. Initial program 62.9%

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\left(x + y\right) + \color{blue}{1 \cdot 1}\right) \cdot \left(x + y\right)} \]
                                            17. fp-cancel-sign-sub-invN/A

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

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

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

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

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

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

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

                                              \[\leadsto \frac{x}{y + x} \cdot \frac{y}{\left(\color{blue}{\left(y + x\right)} - \left(\mathsf{neg}\left(1\right)\right)\right) \cdot \left(x + y\right)} \]
                                            25. metadata-eval87.0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          Alternative 12: 81.2% accurate, 1.2× speedup?

                                          \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-87}:\\ \;\;\;\;\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 (<= y 1.5e-87) (/ y (fma x x x)) (/ (/ x (- y -1.0)) y)))
                                          assert(x < y);
                                          double code(double x, double y) {
                                          	double tmp;
                                          	if (y <= 1.5e-87) {
                                          		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 (y <= 1.5e-87)
                                          		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[y, 1.5e-87], 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}\;y \leq 1.5 \cdot 10^{-87}:\\
                                          \;\;\;\;\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 y < 1.50000000000000008e-87

                                            1. Initial program 71.8%

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

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

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

                                              if 1.50000000000000008e-87 < y

                                              1. Initial program 62.9%

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

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

                                                  \[\leadsto \color{blue}{\frac{x}{\mathsf{fma}\left(y, y, y\right)}} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites77.5%

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

                                                Alternative 13: 65.7% accurate, 1.3× speedup?

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

                                                  1. Initial program 71.8%

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

                                                    \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites38.0%

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

                                                    if 1.02000000000000009e-87 < y < 1

                                                    1. Initial program 89.9%

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

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

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

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

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

                                                        if 1 < y

                                                        1. Initial program 54.5%

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

                                                          \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites76.9%

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

                                                        Alternative 14: 79.2% accurate, 1.6× speedup?

                                                        \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.5 \cdot 10^{-87}:\\ \;\;\;\;\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 (<= y 1.5e-87) (/ y (fma x x x)) (/ x (fma y y y))))
                                                        assert(x < y);
                                                        double code(double x, double y) {
                                                        	double tmp;
                                                        	if (y <= 1.5e-87) {
                                                        		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 (y <= 1.5e-87)
                                                        		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[y, 1.5e-87], 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}\;y \leq 1.5 \cdot 10^{-87}:\\
                                                        \;\;\;\;\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 y < 1.50000000000000008e-87

                                                          1. Initial program 71.8%

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

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

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

                                                            if 1.50000000000000008e-87 < y

                                                            1. Initial program 62.9%

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

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

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

                                                            Alternative 15: 76.2% accurate, 1.6× speedup?

                                                            \[\begin{array}{l} [x, y] = \mathsf{sort}([x, y])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -1400000:\\ \;\;\;\;\frac{y}{x \cdot 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 (<= x -1400000.0) (/ y (* x x)) (/ x (fma y y y))))
                                                            assert(x < y);
                                                            double code(double x, double y) {
                                                            	double tmp;
                                                            	if (x <= -1400000.0) {
                                                            		tmp = y / (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 <= -1400000.0)
                                                            		tmp = Float64(y / Float64(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, -1400000.0], N[(y / N[(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 -1400000:\\
                                                            \;\;\;\;\frac{y}{x \cdot 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 x < -1.4e6

                                                              1. Initial program 64.9%

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

                                                                \[\leadsto \color{blue}{\frac{y}{{x}^{2}}} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites71.3%

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

                                                                if -1.4e6 < x

                                                                1. Initial program 70.1%

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

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

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

                                                                Alternative 16: 47.1% accurate, 1.7× speedup?

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

                                                                  1. Initial program 73.7%

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

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

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

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

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

                                                                      if 1 < y

                                                                      1. Initial program 54.5%

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

                                                                        \[\leadsto \color{blue}{\frac{x}{{y}^{2}}} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites76.9%

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

                                                                      Alternative 17: 26.7% accurate, 3.3× speedup?

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

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

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

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

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

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

                                                                          Developer Target 1: 99.8% accurate, 0.6× speedup?

                                                                          \[\begin{array}{l} \\ \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}} \end{array} \]
                                                                          (FPCore (x y)
                                                                           :precision binary64
                                                                           (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
                                                                          double code(double x, double y) {
                                                                          	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
                                                                          }
                                                                          
                                                                          module fmin_fmax_functions
                                                                              implicit none
                                                                              private
                                                                              public fmax
                                                                              public fmin
                                                                          
                                                                              interface fmax
                                                                                  module procedure fmax88
                                                                                  module procedure fmax44
                                                                                  module procedure fmax84
                                                                                  module procedure fmax48
                                                                              end interface
                                                                              interface fmin
                                                                                  module procedure fmin88
                                                                                  module procedure fmin44
                                                                                  module procedure fmin84
                                                                                  module procedure fmin48
                                                                              end interface
                                                                          contains
                                                                              real(8) function fmax88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmax44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmax48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin88(x, y) result (res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(4) function fmin44(x, y) result (res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin84(x, y) result(res)
                                                                                  real(8), intent (in) :: x
                                                                                  real(4), intent (in) :: y
                                                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                              end function
                                                                              real(8) function fmin48(x, y) result(res)
                                                                                  real(4), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                              end function
                                                                          end module
                                                                          
                                                                          real(8) function code(x, y)
                                                                          use fmin_fmax_functions
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
                                                                          end function
                                                                          
                                                                          public static double code(double x, double y) {
                                                                          	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
                                                                          }
                                                                          
                                                                          def code(x, y):
                                                                          	return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
                                                                          
                                                                          function code(x, y)
                                                                          	return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x))))
                                                                          end
                                                                          
                                                                          function tmp = code(x, y)
                                                                          	tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
                                                                          end
                                                                          
                                                                          code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
                                                                          \end{array}
                                                                          

                                                                          Reproduce

                                                                          ?
                                                                          herbie shell --seed 2025019 
                                                                          (FPCore (x y)
                                                                            :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
                                                                            :precision binary64
                                                                          
                                                                            :alt
                                                                            (! :herbie-platform default (/ (/ (/ x (+ (+ y 1) x)) (+ y x)) (/ 1 (/ y (+ y x)))))
                                                                          
                                                                            (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))