Octave 3.8, jcobi/4

Percentage Accurate: 16.4% → 85.1%
Time: 9.7s
Alternatives: 8
Speedup: 115.0×

Specification

?
\[\left(\alpha > -1 \land \beta > -1\right) \land i > 1\]
\[\begin{array}{l} \\ \begin{array}{l} t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\ t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\ t_2 := t\_1 \cdot t\_1\\ \frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1} \end{array} \end{array} \]
(FPCore (alpha beta i)
 :precision binary64
 (let* ((t_0 (* i (+ (+ alpha beta) i)))
        (t_1 (+ (+ alpha beta) (* 2.0 i)))
        (t_2 (* t_1 t_1)))
   (/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 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(alpha, beta, i)
use fmin_fmax_functions
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = i * ((alpha + beta) + i)
    t_1 = (alpha + beta) + (2.0d0 * i)
    t_2 = t_1 * t_1
    code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i):
	t_0 = i * ((alpha + beta) + i)
	t_1 = (alpha + beta) + (2.0 * i)
	t_2 = t_1 * t_1
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i)
	t_0 = Float64(i * Float64(Float64(alpha + beta) + i))
	t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i))
	t_2 = Float64(t_1 * t_1)
	return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0))
end
function tmp = code(alpha, beta, i)
	t_0 = i * ((alpha + beta) + i);
	t_1 = (alpha + beta) + (2.0 * i);
	t_2 = t_1 * t_1;
	tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\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 8 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: 16.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\ t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\ t_2 := t\_1 \cdot t\_1\\ \frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1} \end{array} \end{array} \]
(FPCore (alpha beta i)
 :precision binary64
 (let* ((t_0 (* i (+ (+ alpha beta) i)))
        (t_1 (+ (+ alpha beta) (* 2.0 i)))
        (t_2 (* t_1 t_1)))
   (/ (/ (* t_0 (+ (* beta alpha) t_0)) t_2) (- t_2 1.0))))
double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 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(alpha, beta, i)
use fmin_fmax_functions
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    t_0 = i * ((alpha + beta) + i)
    t_1 = (alpha + beta) + (2.0d0 * i)
    t_2 = t_1 * t_1
    code = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0d0)
end function
public static double code(double alpha, double beta, double i) {
	double t_0 = i * ((alpha + beta) + i);
	double t_1 = (alpha + beta) + (2.0 * i);
	double t_2 = t_1 * t_1;
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
}
def code(alpha, beta, i):
	t_0 = i * ((alpha + beta) + i)
	t_1 = (alpha + beta) + (2.0 * i)
	t_2 = t_1 * t_1
	return ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0)
function code(alpha, beta, i)
	t_0 = Float64(i * Float64(Float64(alpha + beta) + i))
	t_1 = Float64(Float64(alpha + beta) + Float64(2.0 * i))
	t_2 = Float64(t_1 * t_1)
	return Float64(Float64(Float64(t_0 * Float64(Float64(beta * alpha) + t_0)) / t_2) / Float64(t_2 - 1.0))
end
function tmp = code(alpha, beta, i)
	t_0 = i * ((alpha + beta) + i);
	t_1 = (alpha + beta) + (2.0 * i);
	t_2 = t_1 * t_1;
	tmp = ((t_0 * ((beta * alpha) + t_0)) / t_2) / (t_2 - 1.0);
end
code[alpha_, beta_, i_] := Block[{t$95$0 = N[(i * N[(N[(alpha + beta), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(alpha + beta), $MachinePrecision] + N[(2.0 * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * t$95$1), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[(N[(beta * alpha), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(t$95$2 - 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := i \cdot \left(\left(\alpha + \beta\right) + i\right)\\
t_1 := \left(\alpha + \beta\right) + 2 \cdot i\\
t_2 := t\_1 \cdot t\_1\\
\frac{\frac{t\_0 \cdot \left(\beta \cdot \alpha + t\_0\right)}{t\_2}}{t\_2 - 1}
\end{array}
\end{array}

Alternative 1: 85.1% accurate, 2.2× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{i}{\beta} \cdot \left(\frac{\frac{\alpha}{i} + 1}{\beta} \cdot i\right)\\ \end{array} \end{array} \]
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
(FPCore (alpha beta i)
 :precision binary64
 (if (<= beta 2e+168)
   0.0625
   (* (/ i beta) (* (/ (+ (/ alpha i) 1.0) beta) i))))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 2e+168) {
		tmp = 0.0625;
	} else {
		tmp = (i / beta) * ((((alpha / i) + 1.0) / beta) * i);
	}
	return tmp;
}
NOTE: alpha, beta, and i 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(alpha, beta, i)
use fmin_fmax_functions
    real(8), intent (in) :: alpha
    real(8), intent (in) :: beta
    real(8), intent (in) :: i
    real(8) :: tmp
    if (beta <= 2d+168) then
        tmp = 0.0625d0
    else
        tmp = (i / beta) * ((((alpha / i) + 1.0d0) / beta) * i)
    end if
    code = tmp
end function
assert alpha < beta && beta < i;
public static double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 2e+168) {
		tmp = 0.0625;
	} else {
		tmp = (i / beta) * ((((alpha / i) + 1.0) / beta) * i);
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 2e+168:
		tmp = 0.0625
	else:
		tmp = (i / beta) * ((((alpha / i) + 1.0) / beta) * i)
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 2e+168)
		tmp = 0.0625;
	else
		tmp = Float64(Float64(i / beta) * Float64(Float64(Float64(Float64(alpha / i) + 1.0) / beta) * i));
	end
	return tmp
end
alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
function tmp_2 = code(alpha, beta, i)
	tmp = 0.0;
	if (beta <= 2e+168)
		tmp = 0.0625;
	else
		tmp = (i / beta) * ((((alpha / i) + 1.0) / beta) * i);
	end
	tmp_2 = tmp;
end
NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
code[alpha_, beta_, i_] := If[LessEqual[beta, 2e+168], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(N[(N[(N[(alpha / i), $MachinePrecision] + 1.0), $MachinePrecision] / beta), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\
\;\;\;\;0.0625\\

\mathbf{else}:\\
\;\;\;\;\frac{i}{\beta} \cdot \left(\frac{\frac{\alpha}{i} + 1}{\beta} \cdot i\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if beta < 1.9999999999999999e168

    1. Initial program 21.4%

      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
    2. Add Preprocessing
    3. Taylor expanded in i around inf

      \[\leadsto \color{blue}{\frac{1}{16}} \]
    4. Step-by-step derivation
      1. Applied rewrites83.7%

        \[\leadsto \color{blue}{0.0625} \]

      if 1.9999999999999999e168 < beta

      1. Initial program 0.0%

        \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
      2. Add Preprocessing
      3. Taylor expanded in beta around inf

        \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
        2. unpow2N/A

          \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
        3. times-fracN/A

          \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
        6. lower-+.f64N/A

          \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
        7. lower-/.f6471.3

          \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
      5. Applied rewrites71.3%

        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
      6. Taylor expanded in i around -inf

        \[\leadsto \left(-1 \cdot \left(i \cdot \left(-1 \cdot \frac{\alpha}{\beta \cdot i} - \frac{1}{\beta}\right)\right)\right) \cdot \frac{\color{blue}{i}}{\beta} \]
      7. Step-by-step derivation
        1. Applied rewrites62.8%

          \[\leadsto \left(\left(\frac{-\alpha}{\beta \cdot i} - \frac{1}{\beta}\right) \cdot \left(-i\right)\right) \cdot \frac{\color{blue}{i}}{\beta} \]
        2. Step-by-step derivation
          1. Applied rewrites71.3%

            \[\leadsto \color{blue}{\frac{i}{\beta} \cdot \left(\frac{\frac{-\alpha}{i} - 1}{\beta} \cdot \left(-i\right)\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification82.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{i}{\beta} \cdot \left(\frac{\frac{\alpha}{i} + 1}{\beta} \cdot i\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 2: 85.0% accurate, 3.1× speedup?

        \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{\beta} \cdot \left(i + \alpha\right)}{\beta}\\ \end{array} \end{array} \]
        NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
        (FPCore (alpha beta i)
         :precision binary64
         (if (<= beta 2e+168) 0.0625 (/ (* (/ i beta) (+ i alpha)) beta)))
        assert(alpha < beta && beta < i);
        double code(double alpha, double beta, double i) {
        	double tmp;
        	if (beta <= 2e+168) {
        		tmp = 0.0625;
        	} else {
        		tmp = ((i / beta) * (i + alpha)) / beta;
        	}
        	return tmp;
        }
        
        NOTE: alpha, beta, and i 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(alpha, beta, i)
        use fmin_fmax_functions
            real(8), intent (in) :: alpha
            real(8), intent (in) :: beta
            real(8), intent (in) :: i
            real(8) :: tmp
            if (beta <= 2d+168) then
                tmp = 0.0625d0
            else
                tmp = ((i / beta) * (i + alpha)) / beta
            end if
            code = tmp
        end function
        
        assert alpha < beta && beta < i;
        public static double code(double alpha, double beta, double i) {
        	double tmp;
        	if (beta <= 2e+168) {
        		tmp = 0.0625;
        	} else {
        		tmp = ((i / beta) * (i + alpha)) / beta;
        	}
        	return tmp;
        }
        
        [alpha, beta, i] = sort([alpha, beta, i])
        def code(alpha, beta, i):
        	tmp = 0
        	if beta <= 2e+168:
        		tmp = 0.0625
        	else:
        		tmp = ((i / beta) * (i + alpha)) / beta
        	return tmp
        
        alpha, beta, i = sort([alpha, beta, i])
        function code(alpha, beta, i)
        	tmp = 0.0
        	if (beta <= 2e+168)
        		tmp = 0.0625;
        	else
        		tmp = Float64(Float64(Float64(i / beta) * Float64(i + alpha)) / beta);
        	end
        	return tmp
        end
        
        alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
        function tmp_2 = code(alpha, beta, i)
        	tmp = 0.0;
        	if (beta <= 2e+168)
        		tmp = 0.0625;
        	else
        		tmp = ((i / beta) * (i + alpha)) / beta;
        	end
        	tmp_2 = tmp;
        end
        
        NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
        code[alpha_, beta_, i_] := If[LessEqual[beta, 2e+168], 0.0625, N[(N[(N[(i / beta), $MachinePrecision] * N[(i + alpha), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
        
        \begin{array}{l}
        [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\
        \;\;\;\;0.0625\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{i}{\beta} \cdot \left(i + \alpha\right)}{\beta}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if beta < 1.9999999999999999e168

          1. Initial program 21.4%

            \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
          2. Add Preprocessing
          3. Taylor expanded in i around inf

            \[\leadsto \color{blue}{\frac{1}{16}} \]
          4. Step-by-step derivation
            1. Applied rewrites83.7%

              \[\leadsto \color{blue}{0.0625} \]

            if 1.9999999999999999e168 < beta

            1. Initial program 0.0%

              \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
            2. Add Preprocessing
            3. Taylor expanded in beta around inf

              \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
              2. unpow2N/A

                \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
              3. times-fracN/A

                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
              4. lower-*.f64N/A

                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
              5. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
              6. lower-+.f64N/A

                \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
              7. lower-/.f6471.3

                \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
            5. Applied rewrites71.3%

              \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
            6. Step-by-step derivation
              1. Applied rewrites33.6%

                \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{\beta \cdot \beta}} \]
              2. Step-by-step derivation
                1. Applied rewrites71.4%

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

              Alternative 3: 85.1% accurate, 3.1× speedup?

              \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}\\ \end{array} \end{array} \]
              NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
              (FPCore (alpha beta i)
               :precision binary64
               (if (<= beta 2e+168) 0.0625 (* (/ (+ alpha i) beta) (/ i beta))))
              assert(alpha < beta && beta < i);
              double code(double alpha, double beta, double i) {
              	double tmp;
              	if (beta <= 2e+168) {
              		tmp = 0.0625;
              	} else {
              		tmp = ((alpha + i) / beta) * (i / beta);
              	}
              	return tmp;
              }
              
              NOTE: alpha, beta, and i 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(alpha, beta, i)
              use fmin_fmax_functions
                  real(8), intent (in) :: alpha
                  real(8), intent (in) :: beta
                  real(8), intent (in) :: i
                  real(8) :: tmp
                  if (beta <= 2d+168) then
                      tmp = 0.0625d0
                  else
                      tmp = ((alpha + i) / beta) * (i / beta)
                  end if
                  code = tmp
              end function
              
              assert alpha < beta && beta < i;
              public static double code(double alpha, double beta, double i) {
              	double tmp;
              	if (beta <= 2e+168) {
              		tmp = 0.0625;
              	} else {
              		tmp = ((alpha + i) / beta) * (i / beta);
              	}
              	return tmp;
              }
              
              [alpha, beta, i] = sort([alpha, beta, i])
              def code(alpha, beta, i):
              	tmp = 0
              	if beta <= 2e+168:
              		tmp = 0.0625
              	else:
              		tmp = ((alpha + i) / beta) * (i / beta)
              	return tmp
              
              alpha, beta, i = sort([alpha, beta, i])
              function code(alpha, beta, i)
              	tmp = 0.0
              	if (beta <= 2e+168)
              		tmp = 0.0625;
              	else
              		tmp = Float64(Float64(Float64(alpha + i) / beta) * Float64(i / beta));
              	end
              	return tmp
              end
              
              alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
              function tmp_2 = code(alpha, beta, i)
              	tmp = 0.0;
              	if (beta <= 2e+168)
              		tmp = 0.0625;
              	else
              		tmp = ((alpha + i) / beta) * (i / beta);
              	end
              	tmp_2 = tmp;
              end
              
              NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
              code[alpha_, beta_, i_] := If[LessEqual[beta, 2e+168], 0.0625, N[(N[(N[(alpha + i), $MachinePrecision] / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;\beta \leq 2 \cdot 10^{+168}:\\
              \;\;\;\;0.0625\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if beta < 1.9999999999999999e168

                1. Initial program 21.4%

                  \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                2. Add Preprocessing
                3. Taylor expanded in i around inf

                  \[\leadsto \color{blue}{\frac{1}{16}} \]
                4. Step-by-step derivation
                  1. Applied rewrites83.7%

                    \[\leadsto \color{blue}{0.0625} \]

                  if 1.9999999999999999e168 < beta

                  1. Initial program 0.0%

                    \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                  2. Add Preprocessing
                  3. Taylor expanded in beta around inf

                    \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
                    2. unpow2N/A

                      \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                    3. times-fracN/A

                      \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                    4. lower-*.f64N/A

                      \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                    5. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
                    6. lower-+.f64N/A

                      \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
                    7. lower-/.f6471.3

                      \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
                  5. Applied rewrites71.3%

                    \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                5. Recombined 2 regimes into one program.
                6. Add Preprocessing

                Alternative 4: 82.2% accurate, 3.4× speedup?

                \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 2.5 \cdot 10^{+208}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\ \end{array} \end{array} \]
                NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                (FPCore (alpha beta i)
                 :precision binary64
                 (if (<= beta 2.5e+208) 0.0625 (* (/ i beta) (/ i beta))))
                assert(alpha < beta && beta < i);
                double code(double alpha, double beta, double i) {
                	double tmp;
                	if (beta <= 2.5e+208) {
                		tmp = 0.0625;
                	} else {
                		tmp = (i / beta) * (i / beta);
                	}
                	return tmp;
                }
                
                NOTE: alpha, beta, and i 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(alpha, beta, i)
                use fmin_fmax_functions
                    real(8), intent (in) :: alpha
                    real(8), intent (in) :: beta
                    real(8), intent (in) :: i
                    real(8) :: tmp
                    if (beta <= 2.5d+208) then
                        tmp = 0.0625d0
                    else
                        tmp = (i / beta) * (i / beta)
                    end if
                    code = tmp
                end function
                
                assert alpha < beta && beta < i;
                public static double code(double alpha, double beta, double i) {
                	double tmp;
                	if (beta <= 2.5e+208) {
                		tmp = 0.0625;
                	} else {
                		tmp = (i / beta) * (i / beta);
                	}
                	return tmp;
                }
                
                [alpha, beta, i] = sort([alpha, beta, i])
                def code(alpha, beta, i):
                	tmp = 0
                	if beta <= 2.5e+208:
                		tmp = 0.0625
                	else:
                		tmp = (i / beta) * (i / beta)
                	return tmp
                
                alpha, beta, i = sort([alpha, beta, i])
                function code(alpha, beta, i)
                	tmp = 0.0
                	if (beta <= 2.5e+208)
                		tmp = 0.0625;
                	else
                		tmp = Float64(Float64(i / beta) * Float64(i / beta));
                	end
                	return tmp
                end
                
                alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
                function tmp_2 = code(alpha, beta, i)
                	tmp = 0.0;
                	if (beta <= 2.5e+208)
                		tmp = 0.0625;
                	else
                		tmp = (i / beta) * (i / beta);
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                code[alpha_, beta_, i_] := If[LessEqual[beta, 2.5e+208], 0.0625, N[(N[(i / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;\beta \leq 2.5 \cdot 10^{+208}:\\
                \;\;\;\;0.0625\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{i}{\beta} \cdot \frac{i}{\beta}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if beta < 2.5000000000000002e208

                  1. Initial program 20.0%

                    \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                  2. Add Preprocessing
                  3. Taylor expanded in i around inf

                    \[\leadsto \color{blue}{\frac{1}{16}} \]
                  4. Step-by-step derivation
                    1. Applied rewrites81.6%

                      \[\leadsto \color{blue}{0.0625} \]

                    if 2.5000000000000002e208 < beta

                    1. Initial program 0.0%

                      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                    2. Add Preprocessing
                    3. Taylor expanded in beta around inf

                      \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
                      2. unpow2N/A

                        \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                      3. times-fracN/A

                        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                      4. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                      5. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
                      6. lower-+.f64N/A

                        \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
                      7. lower-/.f6490.0

                        \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
                    5. Applied rewrites90.0%

                      \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                    6. Taylor expanded in alpha around 0

                      \[\leadsto \frac{i}{\beta} \cdot \frac{\color{blue}{i}}{\beta} \]
                    7. Step-by-step derivation
                      1. Applied rewrites79.6%

                        \[\leadsto \frac{i}{\beta} \cdot \frac{\color{blue}{i}}{\beta} \]
                    8. Recombined 2 regimes into one program.
                    9. Add Preprocessing

                    Alternative 5: 74.6% accurate, 3.4× speedup?

                    \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha}{\beta} \cdot \frac{i}{\beta}\\ \end{array} \end{array} \]
                    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                    (FPCore (alpha beta i)
                     :precision binary64
                     (if (<= beta 6.2e+245) 0.0625 (* (/ alpha beta) (/ i beta))))
                    assert(alpha < beta && beta < i);
                    double code(double alpha, double beta, double i) {
                    	double tmp;
                    	if (beta <= 6.2e+245) {
                    		tmp = 0.0625;
                    	} else {
                    		tmp = (alpha / beta) * (i / beta);
                    	}
                    	return tmp;
                    }
                    
                    NOTE: alpha, beta, and i 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(alpha, beta, i)
                    use fmin_fmax_functions
                        real(8), intent (in) :: alpha
                        real(8), intent (in) :: beta
                        real(8), intent (in) :: i
                        real(8) :: tmp
                        if (beta <= 6.2d+245) then
                            tmp = 0.0625d0
                        else
                            tmp = (alpha / beta) * (i / beta)
                        end if
                        code = tmp
                    end function
                    
                    assert alpha < beta && beta < i;
                    public static double code(double alpha, double beta, double i) {
                    	double tmp;
                    	if (beta <= 6.2e+245) {
                    		tmp = 0.0625;
                    	} else {
                    		tmp = (alpha / beta) * (i / beta);
                    	}
                    	return tmp;
                    }
                    
                    [alpha, beta, i] = sort([alpha, beta, i])
                    def code(alpha, beta, i):
                    	tmp = 0
                    	if beta <= 6.2e+245:
                    		tmp = 0.0625
                    	else:
                    		tmp = (alpha / beta) * (i / beta)
                    	return tmp
                    
                    alpha, beta, i = sort([alpha, beta, i])
                    function code(alpha, beta, i)
                    	tmp = 0.0
                    	if (beta <= 6.2e+245)
                    		tmp = 0.0625;
                    	else
                    		tmp = Float64(Float64(alpha / beta) * Float64(i / beta));
                    	end
                    	return tmp
                    end
                    
                    alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
                    function tmp_2 = code(alpha, beta, i)
                    	tmp = 0.0;
                    	if (beta <= 6.2e+245)
                    		tmp = 0.0625;
                    	else
                    		tmp = (alpha / beta) * (i / beta);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                    code[alpha_, beta_, i_] := If[LessEqual[beta, 6.2e+245], 0.0625, N[(N[(alpha / beta), $MachinePrecision] * N[(i / beta), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\
                    \;\;\;\;0.0625\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{\alpha}{\beta} \cdot \frac{i}{\beta}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if beta < 6.1999999999999998e245

                      1. Initial program 19.5%

                        \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                      2. Add Preprocessing
                      3. Taylor expanded in i around inf

                        \[\leadsto \color{blue}{\frac{1}{16}} \]
                      4. Step-by-step derivation
                        1. Applied rewrites80.4%

                          \[\leadsto \color{blue}{0.0625} \]

                        if 6.1999999999999998e245 < beta

                        1. Initial program 0.0%

                          \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                        2. Add Preprocessing
                        3. Taylor expanded in beta around inf

                          \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
                          2. unpow2N/A

                            \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                          3. times-fracN/A

                            \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                          4. lower-*.f64N/A

                            \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                          5. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
                          6. lower-+.f64N/A

                            \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
                          7. lower-/.f6499.6

                            \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
                        5. Applied rewrites99.6%

                          \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                        6. Taylor expanded in alpha around inf

                          \[\leadsto \frac{\alpha}{\beta} \cdot \frac{\color{blue}{i}}{\beta} \]
                        7. Step-by-step derivation
                          1. Applied rewrites73.0%

                            \[\leadsto \frac{\alpha}{\beta} \cdot \frac{\color{blue}{i}}{\beta} \]
                        8. Recombined 2 regimes into one program.
                        9. Add Preprocessing

                        Alternative 6: 73.7% accurate, 3.7× speedup?

                        \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \beta}\\ \end{array} \end{array} \]
                        NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                        (FPCore (alpha beta i)
                         :precision binary64
                         (if (<= beta 6.2e+245) 0.0625 (* (+ alpha i) (/ i (* beta beta)))))
                        assert(alpha < beta && beta < i);
                        double code(double alpha, double beta, double i) {
                        	double tmp;
                        	if (beta <= 6.2e+245) {
                        		tmp = 0.0625;
                        	} else {
                        		tmp = (alpha + i) * (i / (beta * beta));
                        	}
                        	return tmp;
                        }
                        
                        NOTE: alpha, beta, and i 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(alpha, beta, i)
                        use fmin_fmax_functions
                            real(8), intent (in) :: alpha
                            real(8), intent (in) :: beta
                            real(8), intent (in) :: i
                            real(8) :: tmp
                            if (beta <= 6.2d+245) then
                                tmp = 0.0625d0
                            else
                                tmp = (alpha + i) * (i / (beta * beta))
                            end if
                            code = tmp
                        end function
                        
                        assert alpha < beta && beta < i;
                        public static double code(double alpha, double beta, double i) {
                        	double tmp;
                        	if (beta <= 6.2e+245) {
                        		tmp = 0.0625;
                        	} else {
                        		tmp = (alpha + i) * (i / (beta * beta));
                        	}
                        	return tmp;
                        }
                        
                        [alpha, beta, i] = sort([alpha, beta, i])
                        def code(alpha, beta, i):
                        	tmp = 0
                        	if beta <= 6.2e+245:
                        		tmp = 0.0625
                        	else:
                        		tmp = (alpha + i) * (i / (beta * beta))
                        	return tmp
                        
                        alpha, beta, i = sort([alpha, beta, i])
                        function code(alpha, beta, i)
                        	tmp = 0.0
                        	if (beta <= 6.2e+245)
                        		tmp = 0.0625;
                        	else
                        		tmp = Float64(Float64(alpha + i) * Float64(i / Float64(beta * beta)));
                        	end
                        	return tmp
                        end
                        
                        alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
                        function tmp_2 = code(alpha, beta, i)
                        	tmp = 0.0;
                        	if (beta <= 6.2e+245)
                        		tmp = 0.0625;
                        	else
                        		tmp = (alpha + i) * (i / (beta * beta));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                        code[alpha_, beta_, i_] := If[LessEqual[beta, 6.2e+245], 0.0625, N[(N[(alpha + i), $MachinePrecision] * N[(i / N[(beta * beta), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\
                        \;\;\;\;0.0625\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \beta}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if beta < 6.1999999999999998e245

                          1. Initial program 19.5%

                            \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                          2. Add Preprocessing
                          3. Taylor expanded in i around inf

                            \[\leadsto \color{blue}{\frac{1}{16}} \]
                          4. Step-by-step derivation
                            1. Applied rewrites80.4%

                              \[\leadsto \color{blue}{0.0625} \]

                            if 6.1999999999999998e245 < beta

                            1. Initial program 0.0%

                              \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                            2. Add Preprocessing
                            3. Taylor expanded in beta around inf

                              \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
                            4. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
                              2. unpow2N/A

                                \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                              3. times-fracN/A

                                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                              4. lower-*.f64N/A

                                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                              5. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
                              6. lower-+.f64N/A

                                \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
                              7. lower-/.f6499.6

                                \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
                            5. Applied rewrites99.6%

                              \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                            6. Step-by-step derivation
                              1. Applied rewrites57.5%

                                \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{\beta \cdot \beta}} \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 7: 73.6% accurate, 4.1× speedup?

                            \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\ \;\;\;\;0.0625\\ \mathbf{else}:\\ \;\;\;\;\frac{i \cdot \alpha}{\beta \cdot \beta}\\ \end{array} \end{array} \]
                            NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                            (FPCore (alpha beta i)
                             :precision binary64
                             (if (<= beta 6.2e+245) 0.0625 (/ (* i alpha) (* beta beta))))
                            assert(alpha < beta && beta < i);
                            double code(double alpha, double beta, double i) {
                            	double tmp;
                            	if (beta <= 6.2e+245) {
                            		tmp = 0.0625;
                            	} else {
                            		tmp = (i * alpha) / (beta * beta);
                            	}
                            	return tmp;
                            }
                            
                            NOTE: alpha, beta, and i 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(alpha, beta, i)
                            use fmin_fmax_functions
                                real(8), intent (in) :: alpha
                                real(8), intent (in) :: beta
                                real(8), intent (in) :: i
                                real(8) :: tmp
                                if (beta <= 6.2d+245) then
                                    tmp = 0.0625d0
                                else
                                    tmp = (i * alpha) / (beta * beta)
                                end if
                                code = tmp
                            end function
                            
                            assert alpha < beta && beta < i;
                            public static double code(double alpha, double beta, double i) {
                            	double tmp;
                            	if (beta <= 6.2e+245) {
                            		tmp = 0.0625;
                            	} else {
                            		tmp = (i * alpha) / (beta * beta);
                            	}
                            	return tmp;
                            }
                            
                            [alpha, beta, i] = sort([alpha, beta, i])
                            def code(alpha, beta, i):
                            	tmp = 0
                            	if beta <= 6.2e+245:
                            		tmp = 0.0625
                            	else:
                            		tmp = (i * alpha) / (beta * beta)
                            	return tmp
                            
                            alpha, beta, i = sort([alpha, beta, i])
                            function code(alpha, beta, i)
                            	tmp = 0.0
                            	if (beta <= 6.2e+245)
                            		tmp = 0.0625;
                            	else
                            		tmp = Float64(Float64(i * alpha) / Float64(beta * beta));
                            	end
                            	return tmp
                            end
                            
                            alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
                            function tmp_2 = code(alpha, beta, i)
                            	tmp = 0.0;
                            	if (beta <= 6.2e+245)
                            		tmp = 0.0625;
                            	else
                            		tmp = (i * alpha) / (beta * beta);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                            code[alpha_, beta_, i_] := If[LessEqual[beta, 6.2e+245], 0.0625, N[(N[(i * alpha), $MachinePrecision] / N[(beta * beta), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\beta \leq 6.2 \cdot 10^{+245}:\\
                            \;\;\;\;0.0625\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{i \cdot \alpha}{\beta \cdot \beta}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if beta < 6.1999999999999998e245

                              1. Initial program 19.5%

                                \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                              2. Add Preprocessing
                              3. Taylor expanded in i around inf

                                \[\leadsto \color{blue}{\frac{1}{16}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites80.4%

                                  \[\leadsto \color{blue}{0.0625} \]

                                if 6.1999999999999998e245 < beta

                                1. Initial program 0.0%

                                  \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                                2. Add Preprocessing
                                3. Taylor expanded in beta around inf

                                  \[\leadsto \color{blue}{\frac{i \cdot \left(\alpha + i\right)}{{\beta}^{2}}} \]
                                4. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \frac{\color{blue}{\left(\alpha + i\right) \cdot i}}{{\beta}^{2}} \]
                                  2. unpow2N/A

                                    \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                                  3. times-fracN/A

                                    \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                                  4. lower-*.f64N/A

                                    \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                                  5. lower-/.f64N/A

                                    \[\leadsto \color{blue}{\frac{\alpha + i}{\beta}} \cdot \frac{i}{\beta} \]
                                  6. lower-+.f64N/A

                                    \[\leadsto \frac{\color{blue}{\alpha + i}}{\beta} \cdot \frac{i}{\beta} \]
                                  7. lower-/.f6499.6

                                    \[\leadsto \frac{\alpha + i}{\beta} \cdot \color{blue}{\frac{i}{\beta}} \]
                                5. Applied rewrites99.6%

                                  \[\leadsto \color{blue}{\frac{\alpha + i}{\beta} \cdot \frac{i}{\beta}} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites57.5%

                                    \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{\beta \cdot \beta}} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites55.9%

                                      \[\leadsto \frac{\left(i + \alpha\right) \cdot i}{\color{blue}{\beta \cdot \beta}} \]
                                    2. Taylor expanded in alpha around inf

                                      \[\leadsto \frac{\alpha \cdot i}{\color{blue}{\beta} \cdot \beta} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites56.9%

                                        \[\leadsto \frac{i \cdot \alpha}{\color{blue}{\beta} \cdot \beta} \]
                                    4. Recombined 2 regimes into one program.
                                    5. Add Preprocessing

                                    Alternative 8: 70.3% accurate, 115.0× speedup?

                                    \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ 0.0625 \end{array} \]
                                    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                                    (FPCore (alpha beta i) :precision binary64 0.0625)
                                    assert(alpha < beta && beta < i);
                                    double code(double alpha, double beta, double i) {
                                    	return 0.0625;
                                    }
                                    
                                    NOTE: alpha, beta, and i 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(alpha, beta, i)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: alpha
                                        real(8), intent (in) :: beta
                                        real(8), intent (in) :: i
                                        code = 0.0625d0
                                    end function
                                    
                                    assert alpha < beta && beta < i;
                                    public static double code(double alpha, double beta, double i) {
                                    	return 0.0625;
                                    }
                                    
                                    [alpha, beta, i] = sort([alpha, beta, i])
                                    def code(alpha, beta, i):
                                    	return 0.0625
                                    
                                    alpha, beta, i = sort([alpha, beta, i])
                                    function code(alpha, beta, i)
                                    	return 0.0625
                                    end
                                    
                                    alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
                                    function tmp = code(alpha, beta, i)
                                    	tmp = 0.0625;
                                    end
                                    
                                    NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
                                    code[alpha_, beta_, i_] := 0.0625
                                    
                                    \begin{array}{l}
                                    [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
                                    \\
                                    0.0625
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 18.5%

                                      \[\frac{\frac{\left(i \cdot \left(\left(\alpha + \beta\right) + i\right)\right) \cdot \left(\beta \cdot \alpha + i \cdot \left(\left(\alpha + \beta\right) + i\right)\right)}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right)}}{\left(\left(\alpha + \beta\right) + 2 \cdot i\right) \cdot \left(\left(\alpha + \beta\right) + 2 \cdot i\right) - 1} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in i around inf

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

                                        \[\leadsto \color{blue}{0.0625} \]
                                      2. Add Preprocessing

                                      Reproduce

                                      ?
                                      herbie shell --seed 2024357 
                                      (FPCore (alpha beta i)
                                        :name "Octave 3.8, jcobi/4"
                                        :precision binary64
                                        :pre (and (and (> alpha -1.0) (> beta -1.0)) (> i 1.0))
                                        (/ (/ (* (* i (+ (+ alpha beta) i)) (+ (* beta alpha) (* i (+ (+ alpha beta) i)))) (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i)))) (- (* (+ (+ alpha beta) (* 2.0 i)) (+ (+ alpha beta) (* 2.0 i))) 1.0)))