Octave 3.8, jcobi/4

Percentage Accurate: 16.5% → 84.9%
Time: 8.3s
Alternatives: 6
Speedup: 75.4×

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}

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 6 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.5% 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: 84.9% accurate, 4.4× speedup?

\[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 4.8 \cdot 10^{+158}:\\ \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{\beta} \cdot \left(\alpha + i\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 4.8e+158)
   (- 0.0625 (/ -0.015625 (* i i)))
   (/ (* (/ i beta) (+ alpha i)) beta)))
assert(alpha < beta && beta < i);
double code(double alpha, double beta, double i) {
	double tmp;
	if (beta <= 4.8e+158) {
		tmp = 0.0625 - (-0.015625 / (i * i));
	} else {
		tmp = ((i / beta) * (alpha + 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 <= 4.8d+158) then
        tmp = 0.0625d0 - ((-0.015625d0) / (i * i))
    else
        tmp = ((i / beta) * (alpha + 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 <= 4.8e+158) {
		tmp = 0.0625 - (-0.015625 / (i * i));
	} else {
		tmp = ((i / beta) * (alpha + i)) / beta;
	}
	return tmp;
}
[alpha, beta, i] = sort([alpha, beta, i])
def code(alpha, beta, i):
	tmp = 0
	if beta <= 4.8e+158:
		tmp = 0.0625 - (-0.015625 / (i * i))
	else:
		tmp = ((i / beta) * (alpha + i)) / beta
	return tmp
alpha, beta, i = sort([alpha, beta, i])
function code(alpha, beta, i)
	tmp = 0.0
	if (beta <= 4.8e+158)
		tmp = Float64(0.0625 - Float64(-0.015625 / Float64(i * i)));
	else
		tmp = Float64(Float64(Float64(i / beta) * Float64(alpha + 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 <= 4.8e+158)
		tmp = 0.0625 - (-0.015625 / (i * i));
	else
		tmp = ((i / beta) * (alpha + 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, 4.8e+158], N[(0.0625 - N[(-0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i / beta), $MachinePrecision] * N[(alpha + i), $MachinePrecision]), $MachinePrecision] / beta), $MachinePrecision]]
\begin{array}{l}
[alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
\\
\begin{array}{l}
\mathbf{if}\;\beta \leq 4.8 \cdot 10^{+158}:\\
\;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\

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


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

    1. Initial program 23.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. Taylor expanded in beta around 0

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

        \[\leadsto {i}^{2} \cdot \color{blue}{\frac{{\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
      2. lower-*.f64N/A

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

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

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\color{blue}{{\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      5. lower-/.f64N/A

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

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

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      8. lower-+.f64N/A

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\color{blue}{\left(\alpha + 2 \cdot i\right)}}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      9. lower-+.f64N/A

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\left(\alpha + 2 \cdot i\right)}^{\color{blue}{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
      10. *-commutativeN/A

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
      11. lower-*.f64N/A

        \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
    4. Applied rewrites19.1%

      \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right) - 1\right) \cdot \left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right)\right)}} \]
    5. Taylor expanded in i around inf

      \[\leadsto \left(\frac{1}{16} + \frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}}\right) - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}} \]
    6. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
      2. lower-+.f64N/A

        \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
      3. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{1}{256} \cdot \frac{\color{blue}{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}}{{i}^{2}}\right) \]
      4. associate-*r/N/A

        \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{\frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}}\right) \]
      5. sub-divN/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
      6. lower-/.f64N/A

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
    7. Applied rewrites90.0%

      \[\leadsto 0.0625 + \color{blue}{\frac{\mathsf{fma}\left(\alpha \cdot \alpha, 0.0625, -0.00390625 \cdot \mathsf{fma}\left(\alpha \cdot \alpha - 1, 4, \left(\alpha \cdot \alpha\right) \cdot 20\right)\right)}{i \cdot i}} \]
    8. Taylor expanded in alpha around 0

      \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{i \cdot i} \]
    9. Step-by-step derivation
      1. Applied rewrites90.0%

        \[\leadsto 0.0625 + \frac{0.015625}{i \cdot i} \]
      2. Taylor expanded in alpha around 0

        \[\leadsto \frac{1}{16} + \frac{1}{64} \cdot \color{blue}{\frac{1}{{i}^{2}}} \]
      3. Step-by-step derivation
        1. fp-cancel-sign-sub-invN/A

          \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
        2. lower--.f64N/A

          \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
        3. distribute-lft-neg-inN/A

          \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64} \cdot \frac{1}{{i}^{2}}\right)\right) \]
        4. associate-*r/N/A

          \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64} \cdot 1}{{i}^{2}}\right)\right) \]
        5. metadata-evalN/A

          \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64}}{{i}^{2}}\right)\right) \]
        6. distribute-neg-fracN/A

          \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
        7. lower-/.f64N/A

          \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
        8. metadata-evalN/A

          \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{{i}^{2}} \]
        9. pow2N/A

          \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{i \cdot i} \]
        10. lift-*.f6490.0

          \[\leadsto 0.0625 - \frac{-0.015625}{i \cdot i} \]
      4. Applied rewrites90.0%

        \[\leadsto 0.0625 - \frac{-0.015625}{\color{blue}{i \cdot i}} \]

      if 4.80000000000000016e158 < 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. Taylor expanded in beta around inf

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

          \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{{\color{blue}{\beta}}^{2}} \]
        2. associate-/l*N/A

          \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{{\beta}^{2}}} \]
        3. lower-*.f64N/A

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

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

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

          \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
        7. lower-*.f6425.1

          \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
      4. Applied rewrites25.1%

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

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

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

          \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
        4. lift-/.f64N/A

          \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\color{blue}{\beta \cdot \beta}} \]
        5. *-commutativeN/A

          \[\leadsto \frac{i}{\beta \cdot \beta} \cdot \color{blue}{\left(\alpha + i\right)} \]
        6. associate-/r*N/A

          \[\leadsto \frac{\frac{i}{\beta}}{\beta} \cdot \left(\color{blue}{\alpha} + i\right) \]
        7. associate-*l/N/A

          \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
        8. lower-/.f64N/A

          \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
        9. lower-*.f64N/A

          \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
        11. lift-+.f6472.5

          \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
      6. Applied rewrites72.5%

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

    Alternative 2: 83.3% accurate, 5.2× speedup?

    \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 3 \cdot 10^{+166}:\\ \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{\beta} \cdot 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 3e+166)
       (- 0.0625 (/ -0.015625 (* i i)))
       (/ (* (/ i beta) i) beta)))
    assert(alpha < beta && beta < i);
    double code(double alpha, double beta, double i) {
    	double tmp;
    	if (beta <= 3e+166) {
    		tmp = 0.0625 - (-0.015625 / (i * i));
    	} 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 <= 3d+166) then
            tmp = 0.0625d0 - ((-0.015625d0) / (i * i))
        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 <= 3e+166) {
    		tmp = 0.0625 - (-0.015625 / (i * i));
    	} else {
    		tmp = ((i / beta) * i) / beta;
    	}
    	return tmp;
    }
    
    [alpha, beta, i] = sort([alpha, beta, i])
    def code(alpha, beta, i):
    	tmp = 0
    	if beta <= 3e+166:
    		tmp = 0.0625 - (-0.015625 / (i * i))
    	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 <= 3e+166)
    		tmp = Float64(0.0625 - Float64(-0.015625 / Float64(i * i)));
    	else
    		tmp = Float64(Float64(Float64(i / beta) * 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 <= 3e+166)
    		tmp = 0.0625 - (-0.015625 / (i * i));
    	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, 3e+166], N[(0.0625 - N[(-0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i / beta), $MachinePrecision] * i), $MachinePrecision] / beta), $MachinePrecision]]
    
    \begin{array}{l}
    [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;\beta \leq 3 \cdot 10^{+166}:\\
    \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{i}{\beta} \cdot i}{\beta}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if beta < 2.99999999999999998e166

      1. Initial program 22.9%

        \[\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. Taylor expanded in beta around 0

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

          \[\leadsto {i}^{2} \cdot \color{blue}{\frac{{\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
        2. lower-*.f64N/A

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

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

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\color{blue}{{\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
        5. lower-/.f64N/A

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

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

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
        8. lower-+.f64N/A

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\color{blue}{\left(\alpha + 2 \cdot i\right)}}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
        9. lower-+.f64N/A

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\left(\alpha + 2 \cdot i\right)}^{\color{blue}{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
        10. *-commutativeN/A

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
        11. lower-*.f64N/A

          \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
      4. Applied rewrites18.8%

        \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right) - 1\right) \cdot \left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right)\right)}} \]
      5. Taylor expanded in i around inf

        \[\leadsto \left(\frac{1}{16} + \frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}}\right) - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}} \]
      6. Step-by-step derivation
        1. associate--l+N/A

          \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
        2. lower-+.f64N/A

          \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
        3. associate-*r/N/A

          \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{1}{256} \cdot \frac{\color{blue}{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}}{{i}^{2}}\right) \]
        4. associate-*r/N/A

          \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{\frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}}\right) \]
        5. sub-divN/A

          \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
        6. lower-/.f64N/A

          \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
      7. Applied rewrites89.3%

        \[\leadsto 0.0625 + \color{blue}{\frac{\mathsf{fma}\left(\alpha \cdot \alpha, 0.0625, -0.00390625 \cdot \mathsf{fma}\left(\alpha \cdot \alpha - 1, 4, \left(\alpha \cdot \alpha\right) \cdot 20\right)\right)}{i \cdot i}} \]
      8. Taylor expanded in alpha around 0

        \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{i \cdot i} \]
      9. Step-by-step derivation
        1. Applied rewrites89.4%

          \[\leadsto 0.0625 + \frac{0.015625}{i \cdot i} \]
        2. Taylor expanded in alpha around 0

          \[\leadsto \frac{1}{16} + \frac{1}{64} \cdot \color{blue}{\frac{1}{{i}^{2}}} \]
        3. Step-by-step derivation
          1. fp-cancel-sign-sub-invN/A

            \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
          2. lower--.f64N/A

            \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
          3. distribute-lft-neg-inN/A

            \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64} \cdot \frac{1}{{i}^{2}}\right)\right) \]
          4. associate-*r/N/A

            \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64} \cdot 1}{{i}^{2}}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64}}{{i}^{2}}\right)\right) \]
          6. distribute-neg-fracN/A

            \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
          7. lower-/.f64N/A

            \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
          8. metadata-evalN/A

            \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{{i}^{2}} \]
          9. pow2N/A

            \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{i \cdot i} \]
          10. lift-*.f6489.4

            \[\leadsto 0.0625 - \frac{-0.015625}{i \cdot i} \]
        4. Applied rewrites89.4%

          \[\leadsto 0.0625 - \frac{-0.015625}{\color{blue}{i \cdot i}} \]

        if 2.99999999999999998e166 < 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. Taylor expanded in beta around inf

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

            \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{{\color{blue}{\beta}}^{2}} \]
          2. associate-/l*N/A

            \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{{\beta}^{2}}} \]
          3. lower-*.f64N/A

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

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

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

            \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
          7. lower-*.f6426.0

            \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
        4. Applied rewrites26.0%

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

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

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

            \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
          4. lift-/.f64N/A

            \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\color{blue}{\beta \cdot \beta}} \]
          5. *-commutativeN/A

            \[\leadsto \frac{i}{\beta \cdot \beta} \cdot \color{blue}{\left(\alpha + i\right)} \]
          6. associate-/r*N/A

            \[\leadsto \frac{\frac{i}{\beta}}{\beta} \cdot \left(\color{blue}{\alpha} + i\right) \]
          7. associate-*l/N/A

            \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
          8. lower-/.f64N/A

            \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
          9. lower-*.f64N/A

            \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
          10. lower-/.f64N/A

            \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
          11. lift-+.f6473.6

            \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
        6. Applied rewrites73.6%

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

          \[\leadsto \frac{\frac{i}{\beta} \cdot i}{\beta} \]
        8. Step-by-step derivation
          1. Applied rewrites67.5%

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

        Alternative 3: 75.8% accurate, 5.2× speedup?

        \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 6.5 \cdot 10^{+215}:\\ \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{i}{\beta} \cdot \alpha}{\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.5e+215)
           (- 0.0625 (/ -0.015625 (* i i)))
           (/ (* (/ i beta) alpha) beta)))
        assert(alpha < beta && beta < i);
        double code(double alpha, double beta, double i) {
        	double tmp;
        	if (beta <= 6.5e+215) {
        		tmp = 0.0625 - (-0.015625 / (i * i));
        	} else {
        		tmp = ((i / beta) * 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 <= 6.5d+215) then
                tmp = 0.0625d0 - ((-0.015625d0) / (i * i))
            else
                tmp = ((i / beta) * 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 <= 6.5e+215) {
        		tmp = 0.0625 - (-0.015625 / (i * i));
        	} else {
        		tmp = ((i / beta) * alpha) / beta;
        	}
        	return tmp;
        }
        
        [alpha, beta, i] = sort([alpha, beta, i])
        def code(alpha, beta, i):
        	tmp = 0
        	if beta <= 6.5e+215:
        		tmp = 0.0625 - (-0.015625 / (i * i))
        	else:
        		tmp = ((i / beta) * alpha) / beta
        	return tmp
        
        alpha, beta, i = sort([alpha, beta, i])
        function code(alpha, beta, i)
        	tmp = 0.0
        	if (beta <= 6.5e+215)
        		tmp = Float64(0.0625 - Float64(-0.015625 / Float64(i * i)));
        	else
        		tmp = Float64(Float64(Float64(i / beta) * 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 <= 6.5e+215)
        		tmp = 0.0625 - (-0.015625 / (i * i));
        	else
        		tmp = ((i / beta) * 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, 6.5e+215], N[(0.0625 - N[(-0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i / beta), $MachinePrecision] * alpha), $MachinePrecision] / beta), $MachinePrecision]]
        
        \begin{array}{l}
        [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;\beta \leq 6.5 \cdot 10^{+215}:\\
        \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{i}{\beta} \cdot \alpha}{\beta}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if beta < 6.4999999999999997e215

          1. Initial program 20.3%

            \[\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. Taylor expanded in beta around 0

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

              \[\leadsto {i}^{2} \cdot \color{blue}{\frac{{\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
            2. lower-*.f64N/A

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

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

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\color{blue}{{\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
            5. lower-/.f64N/A

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

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

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
            8. lower-+.f64N/A

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\color{blue}{\left(\alpha + 2 \cdot i\right)}}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
            9. lower-+.f64N/A

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\left(\alpha + 2 \cdot i\right)}^{\color{blue}{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
            10. *-commutativeN/A

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
            11. lower-*.f64N/A

              \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
          4. Applied rewrites16.9%

            \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right) - 1\right) \cdot \left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right)\right)}} \]
          5. Taylor expanded in i around inf

            \[\leadsto \left(\frac{1}{16} + \frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}}\right) - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}} \]
          6. Step-by-step derivation
            1. associate--l+N/A

              \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
            2. lower-+.f64N/A

              \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
            3. associate-*r/N/A

              \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{1}{256} \cdot \frac{\color{blue}{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}}{{i}^{2}}\right) \]
            4. associate-*r/N/A

              \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{\frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}}\right) \]
            5. sub-divN/A

              \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
            6. lower-/.f64N/A

              \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
          7. Applied rewrites83.7%

            \[\leadsto 0.0625 + \color{blue}{\frac{\mathsf{fma}\left(\alpha \cdot \alpha, 0.0625, -0.00390625 \cdot \mathsf{fma}\left(\alpha \cdot \alpha - 1, 4, \left(\alpha \cdot \alpha\right) \cdot 20\right)\right)}{i \cdot i}} \]
          8. Taylor expanded in alpha around 0

            \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{i \cdot i} \]
          9. Step-by-step derivation
            1. Applied rewrites84.1%

              \[\leadsto 0.0625 + \frac{0.015625}{i \cdot i} \]
            2. Taylor expanded in alpha around 0

              \[\leadsto \frac{1}{16} + \frac{1}{64} \cdot \color{blue}{\frac{1}{{i}^{2}}} \]
            3. Step-by-step derivation
              1. fp-cancel-sign-sub-invN/A

                \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
              2. lower--.f64N/A

                \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
              3. distribute-lft-neg-inN/A

                \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64} \cdot \frac{1}{{i}^{2}}\right)\right) \]
              4. associate-*r/N/A

                \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64} \cdot 1}{{i}^{2}}\right)\right) \]
              5. metadata-evalN/A

                \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64}}{{i}^{2}}\right)\right) \]
              6. distribute-neg-fracN/A

                \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
              7. lower-/.f64N/A

                \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
              8. metadata-evalN/A

                \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{{i}^{2}} \]
              9. pow2N/A

                \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{i \cdot i} \]
              10. lift-*.f6484.1

                \[\leadsto 0.0625 - \frac{-0.015625}{i \cdot i} \]
            4. Applied rewrites84.1%

              \[\leadsto 0.0625 - \frac{-0.015625}{\color{blue}{i \cdot i}} \]

            if 6.4999999999999997e215 < 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. Taylor expanded in beta around inf

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

                \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{{\color{blue}{\beta}}^{2}} \]
              2. associate-/l*N/A

                \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{{\beta}^{2}}} \]
              3. lower-*.f64N/A

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

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

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

                \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
              7. lower-*.f6432.4

                \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
            4. Applied rewrites32.4%

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

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

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

                \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
              4. lift-/.f64N/A

                \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\color{blue}{\beta \cdot \beta}} \]
              5. *-commutativeN/A

                \[\leadsto \frac{i}{\beta \cdot \beta} \cdot \color{blue}{\left(\alpha + i\right)} \]
              6. associate-/r*N/A

                \[\leadsto \frac{\frac{i}{\beta}}{\beta} \cdot \left(\color{blue}{\alpha} + i\right) \]
              7. associate-*l/N/A

                \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
              8. lower-/.f64N/A

                \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\color{blue}{\beta}} \]
              9. lower-*.f64N/A

                \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
              10. lower-/.f64N/A

                \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
              11. lift-+.f6482.1

                \[\leadsto \frac{\frac{i}{\beta} \cdot \left(\alpha + i\right)}{\beta} \]
            6. Applied rewrites82.1%

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

              \[\leadsto \frac{\frac{i}{\beta} \cdot \alpha}{\beta} \]
            8. Step-by-step derivation
              1. Applied rewrites38.9%

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

            Alternative 4: 74.5% accurate, 5.4× speedup?

            \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ \begin{array}{l} \mathbf{if}\;\beta \leq 7.8 \cdot 10^{+216}:\\ \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\ \mathbf{else}:\\ \;\;\;\;\frac{\alpha}{\beta \cdot \beta} \cdot i\\ \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 7.8e+216)
               (- 0.0625 (/ -0.015625 (* i i)))
               (* (/ alpha (* beta beta)) i)))
            assert(alpha < beta && beta < i);
            double code(double alpha, double beta, double i) {
            	double tmp;
            	if (beta <= 7.8e+216) {
            		tmp = 0.0625 - (-0.015625 / (i * i));
            	} else {
            		tmp = (alpha / (beta * 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 <= 7.8d+216) then
                    tmp = 0.0625d0 - ((-0.015625d0) / (i * i))
                else
                    tmp = (alpha / (beta * 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 <= 7.8e+216) {
            		tmp = 0.0625 - (-0.015625 / (i * i));
            	} else {
            		tmp = (alpha / (beta * beta)) * i;
            	}
            	return tmp;
            }
            
            [alpha, beta, i] = sort([alpha, beta, i])
            def code(alpha, beta, i):
            	tmp = 0
            	if beta <= 7.8e+216:
            		tmp = 0.0625 - (-0.015625 / (i * i))
            	else:
            		tmp = (alpha / (beta * beta)) * i
            	return tmp
            
            alpha, beta, i = sort([alpha, beta, i])
            function code(alpha, beta, i)
            	tmp = 0.0
            	if (beta <= 7.8e+216)
            		tmp = Float64(0.0625 - Float64(-0.015625 / Float64(i * i)));
            	else
            		tmp = Float64(Float64(alpha / Float64(beta * 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 <= 7.8e+216)
            		tmp = 0.0625 - (-0.015625 / (i * i));
            	else
            		tmp = (alpha / (beta * 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, 7.8e+216], N[(0.0625 - N[(-0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(alpha / N[(beta * beta), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]]
            
            \begin{array}{l}
            [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;\beta \leq 7.8 \cdot 10^{+216}:\\
            \;\;\;\;0.0625 - \frac{-0.015625}{i \cdot i}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\alpha}{\beta \cdot \beta} \cdot i\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if beta < 7.79999999999999962e216

              1. Initial program 20.2%

                \[\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. Taylor expanded in beta around 0

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

                  \[\leadsto {i}^{2} \cdot \color{blue}{\frac{{\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
                2. lower-*.f64N/A

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

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

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\color{blue}{{\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                5. lower-/.f64N/A

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

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

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                8. lower-+.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\color{blue}{\left(\alpha + 2 \cdot i\right)}}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                9. lower-+.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\left(\alpha + 2 \cdot i\right)}^{\color{blue}{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                10. *-commutativeN/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
                11. lower-*.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
              4. Applied rewrites16.8%

                \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right) - 1\right) \cdot \left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right)\right)}} \]
              5. Taylor expanded in i around inf

                \[\leadsto \left(\frac{1}{16} + \frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}}\right) - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}} \]
              6. Step-by-step derivation
                1. associate--l+N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
                2. lower-+.f64N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
                3. associate-*r/N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{1}{256} \cdot \frac{\color{blue}{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}}{{i}^{2}}\right) \]
                4. associate-*r/N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{\frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}}\right) \]
                5. sub-divN/A

                  \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
                6. lower-/.f64N/A

                  \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
              7. Applied rewrites83.6%

                \[\leadsto 0.0625 + \color{blue}{\frac{\mathsf{fma}\left(\alpha \cdot \alpha, 0.0625, -0.00390625 \cdot \mathsf{fma}\left(\alpha \cdot \alpha - 1, 4, \left(\alpha \cdot \alpha\right) \cdot 20\right)\right)}{i \cdot i}} \]
              8. Taylor expanded in alpha around 0

                \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{i \cdot i} \]
              9. Step-by-step derivation
                1. Applied rewrites83.9%

                  \[\leadsto 0.0625 + \frac{0.015625}{i \cdot i} \]
                2. Taylor expanded in alpha around 0

                  \[\leadsto \frac{1}{16} + \frac{1}{64} \cdot \color{blue}{\frac{1}{{i}^{2}}} \]
                3. Step-by-step derivation
                  1. fp-cancel-sign-sub-invN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
                  2. lower--.f64N/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
                  3. distribute-lft-neg-inN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64} \cdot \frac{1}{{i}^{2}}\right)\right) \]
                  4. associate-*r/N/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64} \cdot 1}{{i}^{2}}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64}}{{i}^{2}}\right)\right) \]
                  6. distribute-neg-fracN/A

                    \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
                  7. lower-/.f64N/A

                    \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{{i}^{2}} \]
                  9. pow2N/A

                    \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{i \cdot i} \]
                  10. lift-*.f6483.9

                    \[\leadsto 0.0625 - \frac{-0.015625}{i \cdot i} \]
                4. Applied rewrites83.9%

                  \[\leadsto 0.0625 - \frac{-0.015625}{\color{blue}{i \cdot i}} \]

                if 7.79999999999999962e216 < 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. Taylor expanded in beta around inf

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

                    \[\leadsto \frac{\left(\alpha + i\right) \cdot i}{{\color{blue}{\beta}}^{2}} \]
                  2. associate-/l*N/A

                    \[\leadsto \left(\alpha + i\right) \cdot \color{blue}{\frac{i}{{\beta}^{2}}} \]
                  3. lower-*.f64N/A

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

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

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

                    \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
                  7. lower-*.f6432.5

                    \[\leadsto \left(\alpha + i\right) \cdot \frac{i}{\beta \cdot \color{blue}{\beta}} \]
                4. Applied rewrites32.5%

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

                  \[\leadsto \frac{\alpha \cdot i}{\color{blue}{{\beta}^{2}}} \]
                6. Step-by-step derivation
                  1. associate-*l/N/A

                    \[\leadsto \frac{\alpha}{{\beta}^{2}} \cdot i \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{\alpha}{{\beta}^{2}} \cdot i \]
                  3. lower-/.f64N/A

                    \[\leadsto \frac{\alpha}{{\beta}^{2}} \cdot i \]
                  4. pow2N/A

                    \[\leadsto \frac{\alpha}{\beta \cdot \beta} \cdot i \]
                  5. lift-*.f6432.5

                    \[\leadsto \frac{\alpha}{\beta \cdot \beta} \cdot i \]
                7. Applied rewrites32.5%

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

              Alternative 5: 71.9% accurate, 7.6× speedup?

              \[\begin{array}{l} [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\ \\ 0.0625 - \frac{-0.015625}{i \cdot i} \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 (/ -0.015625 (* i i))))
              assert(alpha < beta && beta < i);
              double code(double alpha, double beta, double i) {
              	return 0.0625 - (-0.015625 / (i * i));
              }
              
              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 - ((-0.015625d0) / (i * i))
              end function
              
              assert alpha < beta && beta < i;
              public static double code(double alpha, double beta, double i) {
              	return 0.0625 - (-0.015625 / (i * i));
              }
              
              [alpha, beta, i] = sort([alpha, beta, i])
              def code(alpha, beta, i):
              	return 0.0625 - (-0.015625 / (i * i))
              
              alpha, beta, i = sort([alpha, beta, i])
              function code(alpha, beta, i)
              	return Float64(0.0625 - Float64(-0.015625 / Float64(i * i)))
              end
              
              alpha, beta, i = num2cell(sort([alpha, beta, i])){:}
              function tmp = code(alpha, beta, i)
              	tmp = 0.0625 - (-0.015625 / (i * i));
              end
              
              NOTE: alpha, beta, and i should be sorted in increasing order before calling this function.
              code[alpha_, beta_, i_] := N[(0.0625 - N[(-0.015625 / N[(i * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              [alpha, beta, i] = \mathsf{sort}([alpha, beta, i])\\
              \\
              0.0625 - \frac{-0.015625}{i \cdot i}
              \end{array}
              
              Derivation
              1. Initial program 16.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. Taylor expanded in beta around 0

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

                  \[\leadsto {i}^{2} \cdot \color{blue}{\frac{{\left(\alpha + i\right)}^{2}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)}} \]
                2. lower-*.f64N/A

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

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

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\color{blue}{{\left(\alpha + i\right)}^{2}}}{{\left(\alpha + 2 \cdot i\right)}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                5. lower-/.f64N/A

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

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

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                8. lower-+.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\color{blue}{\left(\alpha + 2 \cdot i\right)}}^{2} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                9. lower-+.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{{\left(\alpha + 2 \cdot i\right)}^{\color{blue}{2}} \cdot \left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right)} \]
                10. *-commutativeN/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
                11. lower-*.f64N/A

                  \[\leadsto \left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left({\left(\alpha + 2 \cdot i\right)}^{2} - 1\right) \cdot \color{blue}{{\left(\alpha + 2 \cdot i\right)}^{2}}} \]
              4. Applied rewrites15.9%

                \[\leadsto \color{blue}{\left(i \cdot i\right) \cdot \frac{\left(\alpha + i\right) \cdot \left(\alpha + i\right)}{\left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right) - 1\right) \cdot \left(\mathsf{fma}\left(2, i, \alpha\right) \cdot \mathsf{fma}\left(2, i, \alpha\right)\right)}} \]
              5. Taylor expanded in i around inf

                \[\leadsto \left(\frac{1}{16} + \frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}}\right) - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}} \]
              6. Step-by-step derivation
                1. associate--l+N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
                2. lower-+.f64N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{1}{16} \cdot \frac{{\alpha}^{2}}{{i}^{2}} - \color{blue}{\frac{1}{256} \cdot \frac{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}{{i}^{2}}}\right) \]
                3. associate-*r/N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{1}{256} \cdot \frac{\color{blue}{4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)}}{{i}^{2}}\right) \]
                4. associate-*r/N/A

                  \[\leadsto \frac{1}{16} + \left(\frac{\frac{1}{16} \cdot {\alpha}^{2}}{{i}^{2}} - \frac{\frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}}\right) \]
                5. sub-divN/A

                  \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
                6. lower-/.f64N/A

                  \[\leadsto \frac{1}{16} + \frac{\frac{1}{16} \cdot {\alpha}^{2} - \frac{1}{256} \cdot \left(4 \cdot \left({\alpha}^{2} - 1\right) + \left(4 \cdot {\alpha}^{2} + 16 \cdot {\alpha}^{2}\right)\right)}{{i}^{\color{blue}{2}}} \]
              7. Applied rewrites71.2%

                \[\leadsto 0.0625 + \color{blue}{\frac{\mathsf{fma}\left(\alpha \cdot \alpha, 0.0625, -0.00390625 \cdot \mathsf{fma}\left(\alpha \cdot \alpha - 1, 4, \left(\alpha \cdot \alpha\right) \cdot 20\right)\right)}{i \cdot i}} \]
              8. Taylor expanded in alpha around 0

                \[\leadsto \frac{1}{16} + \frac{\frac{1}{64}}{i \cdot i} \]
              9. Step-by-step derivation
                1. Applied rewrites71.9%

                  \[\leadsto 0.0625 + \frac{0.015625}{i \cdot i} \]
                2. Taylor expanded in alpha around 0

                  \[\leadsto \frac{1}{16} + \frac{1}{64} \cdot \color{blue}{\frac{1}{{i}^{2}}} \]
                3. Step-by-step derivation
                  1. fp-cancel-sign-sub-invN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
                  2. lower--.f64N/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64}\right)\right) \cdot \frac{1}{\color{blue}{{i}^{2}}} \]
                  3. distribute-lft-neg-inN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{1}{64} \cdot \frac{1}{{i}^{2}}\right)\right) \]
                  4. associate-*r/N/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64} \cdot 1}{{i}^{2}}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \frac{1}{16} - \left(\mathsf{neg}\left(\frac{\frac{1}{64}}{{i}^{2}}\right)\right) \]
                  6. distribute-neg-fracN/A

                    \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
                  7. lower-/.f64N/A

                    \[\leadsto \frac{1}{16} - \frac{\mathsf{neg}\left(\frac{1}{64}\right)}{{i}^{2}} \]
                  8. metadata-evalN/A

                    \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{{i}^{2}} \]
                  9. pow2N/A

                    \[\leadsto \frac{1}{16} - \frac{\frac{-1}{64}}{i \cdot i} \]
                  10. lift-*.f6471.9

                    \[\leadsto 0.0625 - \frac{-0.015625}{i \cdot i} \]
                4. Applied rewrites71.9%

                  \[\leadsto 0.0625 - \frac{-0.015625}{\color{blue}{i \cdot i}} \]
                5. Add Preprocessing

                Alternative 6: 71.7% accurate, 75.4× 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 16.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. Taylor expanded in i around inf

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

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

                  Reproduce

                  ?
                  herbie shell --seed 2025130 
                  (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)))