Toniolo and Linder, Equation (10-)

Percentage Accurate: 37.2% → 94.8%
Time: 11.0s
Alternatives: 23
Speedup: 9.6×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 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(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 23 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: 37.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 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(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)}
\end{array}

Alternative 1: 94.8% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell}{{\sin k\_m}^{2}} \cdot \frac{2}{k\_m}\right) \cdot \frac{\frac{\cos k\_m \cdot \ell}{t}}{k\_m}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 7.8e-140)
   (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
   (*
    (* (/ l (pow (sin k_m) 2.0)) (/ 2.0 k_m))
    (/ (/ (* (cos k_m) l) t) k_m))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 7.8e-140) {
		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
	} else {
		tmp = ((l / pow(sin(k_m), 2.0)) * (2.0 / k_m)) * (((cos(k_m) * l) / t) / k_m);
	}
	return tmp;
}
k_m =     private
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(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 7.8d-140) then
        tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
    else
        tmp = ((l / (sin(k_m) ** 2.0d0)) * (2.0d0 / k_m)) * (((cos(k_m) * l) / t) / k_m)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 7.8e-140) {
		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
	} else {
		tmp = ((l / Math.pow(Math.sin(k_m), 2.0)) * (2.0 / k_m)) * (((Math.cos(k_m) * l) / t) / k_m);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 7.8e-140:
		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
	else:
		tmp = ((l / math.pow(math.sin(k_m), 2.0)) * (2.0 / k_m)) * (((math.cos(k_m) * l) / t) / k_m)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 7.8e-140)
		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
	else
		tmp = Float64(Float64(Float64(l / (sin(k_m) ^ 2.0)) * Float64(2.0 / k_m)) * Float64(Float64(Float64(cos(k_m) * l) / t) / k_m));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 7.8e-140)
		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
	else
		tmp = ((l / (sin(k_m) ^ 2.0)) * (2.0 / k_m)) * (((cos(k_m) * l) / t) / k_m);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 7.8e-140], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(2.0 / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\
\;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{\ell}{{\sin k\_m}^{2}} \cdot \frac{2}{k\_m}\right) \cdot \frac{\frac{\cos k\_m \cdot \ell}{t}}{k\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 7.80000000000000038e-140

    1. Initial program 35.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    4. Step-by-step derivation
      1. Applied rewrites73.4%

        \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
      2. Taylor expanded in k around 0

        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
      3. Step-by-step derivation
        1. Applied rewrites76.6%

          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
        2. Step-by-step derivation
          1. Applied rewrites80.9%

            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
          2. Step-by-step derivation
            1. Applied rewrites80.9%

              \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

            if 7.80000000000000038e-140 < k

            1. Initial program 32.2%

              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in t around 0

              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
            4. Step-by-step derivation
              1. Applied rewrites66.6%

                \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
              2. Taylor expanded in t around 0

                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
              3. Step-by-step derivation
                1. Applied rewrites81.0%

                  \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                2. Step-by-step derivation
                  1. Applied rewrites90.3%

                    \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites97.4%

                      \[\leadsto \left(\frac{\ell}{{\sin k}^{2}} \cdot \frac{2}{k}\right) \cdot \color{blue}{\frac{\frac{\cos k \cdot \ell}{t}}{k}} \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification86.9%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell}{{\sin k}^{2}} \cdot \frac{2}{k}\right) \cdot \frac{\frac{\cos k \cdot \ell}{t}}{k}\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 2: 96.5% accurate, 1.3× speedup?

                  \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := {\sin k\_m}^{2}\\ \mathbf{if}\;k\_m \leq 3.7 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 9.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{\ell}{t\_1} \cdot \left(\left(2 \cdot \frac{\ell}{k\_m \cdot k\_m}\right) \cdot \frac{\cos k\_m}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\cos k\_m \cdot \ell\right) \cdot 2}{k\_m \cdot t} \cdot \frac{\ell}{k\_m}}{t\_1}\\ \end{array} \end{array} \]
                  k_m = (fabs.f64 k)
                  (FPCore (t l k_m)
                   :precision binary64
                   (let* ((t_1 (pow (sin k_m) 2.0)))
                     (if (<= k_m 3.7e-140)
                       (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                       (if (<= k_m 9.2e+144)
                         (* (/ l t_1) (* (* 2.0 (/ l (* k_m k_m))) (/ (cos k_m) t)))
                         (/ (* (/ (* (* (cos k_m) l) 2.0) (* k_m t)) (/ l k_m)) t_1)))))
                  k_m = fabs(k);
                  double code(double t, double l, double k_m) {
                  	double t_1 = pow(sin(k_m), 2.0);
                  	double tmp;
                  	if (k_m <= 3.7e-140) {
                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                  	} else if (k_m <= 9.2e+144) {
                  		tmp = (l / t_1) * ((2.0 * (l / (k_m * k_m))) * (cos(k_m) / t));
                  	} else {
                  		tmp = ((((cos(k_m) * l) * 2.0) / (k_m * t)) * (l / k_m)) / t_1;
                  	}
                  	return tmp;
                  }
                  
                  k_m =     private
                  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(t, l, k_m)
                  use fmin_fmax_functions
                      real(8), intent (in) :: t
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k_m
                      real(8) :: t_1
                      real(8) :: tmp
                      t_1 = sin(k_m) ** 2.0d0
                      if (k_m <= 3.7d-140) then
                          tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                      else if (k_m <= 9.2d+144) then
                          tmp = (l / t_1) * ((2.0d0 * (l / (k_m * k_m))) * (cos(k_m) / t))
                      else
                          tmp = ((((cos(k_m) * l) * 2.0d0) / (k_m * t)) * (l / k_m)) / t_1
                      end if
                      code = tmp
                  end function
                  
                  k_m = Math.abs(k);
                  public static double code(double t, double l, double k_m) {
                  	double t_1 = Math.pow(Math.sin(k_m), 2.0);
                  	double tmp;
                  	if (k_m <= 3.7e-140) {
                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                  	} else if (k_m <= 9.2e+144) {
                  		tmp = (l / t_1) * ((2.0 * (l / (k_m * k_m))) * (Math.cos(k_m) / t));
                  	} else {
                  		tmp = ((((Math.cos(k_m) * l) * 2.0) / (k_m * t)) * (l / k_m)) / t_1;
                  	}
                  	return tmp;
                  }
                  
                  k_m = math.fabs(k)
                  def code(t, l, k_m):
                  	t_1 = math.pow(math.sin(k_m), 2.0)
                  	tmp = 0
                  	if k_m <= 3.7e-140:
                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                  	elif k_m <= 9.2e+144:
                  		tmp = (l / t_1) * ((2.0 * (l / (k_m * k_m))) * (math.cos(k_m) / t))
                  	else:
                  		tmp = ((((math.cos(k_m) * l) * 2.0) / (k_m * t)) * (l / k_m)) / t_1
                  	return tmp
                  
                  k_m = abs(k)
                  function code(t, l, k_m)
                  	t_1 = sin(k_m) ^ 2.0
                  	tmp = 0.0
                  	if (k_m <= 3.7e-140)
                  		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                  	elseif (k_m <= 9.2e+144)
                  		tmp = Float64(Float64(l / t_1) * Float64(Float64(2.0 * Float64(l / Float64(k_m * k_m))) * Float64(cos(k_m) / t)));
                  	else
                  		tmp = Float64(Float64(Float64(Float64(Float64(cos(k_m) * l) * 2.0) / Float64(k_m * t)) * Float64(l / k_m)) / t_1);
                  	end
                  	return tmp
                  end
                  
                  k_m = abs(k);
                  function tmp_2 = code(t, l, k_m)
                  	t_1 = sin(k_m) ^ 2.0;
                  	tmp = 0.0;
                  	if (k_m <= 3.7e-140)
                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                  	elseif (k_m <= 9.2e+144)
                  		tmp = (l / t_1) * ((2.0 * (l / (k_m * k_m))) * (cos(k_m) / t));
                  	else
                  		tmp = ((((cos(k_m) * l) * 2.0) / (k_m * t)) * (l / k_m)) / t_1;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  k_m = N[Abs[k], $MachinePrecision]
                  code[t_, l_, k$95$m_] := Block[{t$95$1 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 3.7e-140], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 9.2e+144], N[(N[(l / t$95$1), $MachinePrecision] * N[(N[(2.0 * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  k_m = \left|k\right|
                  
                  \\
                  \begin{array}{l}
                  t_1 := {\sin k\_m}^{2}\\
                  \mathbf{if}\;k\_m \leq 3.7 \cdot 10^{-140}:\\
                  \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                  
                  \mathbf{elif}\;k\_m \leq 9.2 \cdot 10^{+144}:\\
                  \;\;\;\;\frac{\ell}{t\_1} \cdot \left(\left(2 \cdot \frac{\ell}{k\_m \cdot k\_m}\right) \cdot \frac{\cos k\_m}{t}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\frac{\left(\cos k\_m \cdot \ell\right) \cdot 2}{k\_m \cdot t} \cdot \frac{\ell}{k\_m}}{t\_1}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if k < 3.69999999999999977e-140

                    1. Initial program 35.1%

                      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                    2. Add Preprocessing
                    3. Taylor expanded in t around 0

                      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites73.4%

                        \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                      2. Taylor expanded in k around 0

                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites76.6%

                          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                        2. Step-by-step derivation
                          1. Applied rewrites80.9%

                            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites80.9%

                              \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                            if 3.69999999999999977e-140 < k < 9.2000000000000006e144

                            1. Initial program 31.6%

                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                            2. Add Preprocessing
                            3. Taylor expanded in t around 0

                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                            4. Step-by-step derivation
                              1. Applied rewrites76.9%

                                \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                              2. Taylor expanded in t around 0

                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites88.4%

                                  \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                2. Taylor expanded in t around 0

                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                3. Applied rewrites98.5%

                                  \[\leadsto \color{blue}{\frac{\ell}{{\sin k}^{2}} \cdot \left(\left(2 \cdot \frac{\ell}{k \cdot k}\right) \cdot \frac{\cos k}{t}\right)} \]

                                if 9.2000000000000006e144 < k

                                1. Initial program 33.4%

                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                2. Add Preprocessing
                                3. Taylor expanded in t around 0

                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites48.7%

                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                  2. Taylor expanded in t around 0

                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites68.2%

                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites52.9%

                                        \[\leadsto \frac{\left(\left(\cos k \cdot \ell\right) \cdot \frac{\frac{\frac{2}{k}}{k}}{t}\right) \cdot \ell}{\color{blue}{{\sin k}^{2}}} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites83.8%

                                          \[\leadsto \frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k \cdot t} \cdot \frac{\ell}{k}}{{\color{blue}{\sin k}}^{2}} \]
                                      3. Recombined 3 regimes into one program.
                                      4. Final simplification85.4%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 3.7 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 9.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{\ell}{{\sin k}^{2}} \cdot \left(\left(2 \cdot \frac{\ell}{k \cdot k}\right) \cdot \frac{\cos k}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k \cdot t} \cdot \frac{\ell}{k}}{{\sin k}^{2}}\\ \end{array} \]
                                      5. Add Preprocessing

                                      Alternative 3: 95.2% accurate, 1.3× speedup?

                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \left(\cos k\_m \cdot \ell\right) \cdot 2\\ t_2 := {\sin k\_m}^{2}\\ \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 8.5 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{t\_1}{t} \cdot \frac{\ell}{k\_m \cdot k\_m}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{t\_1}{k\_m \cdot t} \cdot \frac{\ell}{k\_m}}{t\_2}\\ \end{array} \end{array} \]
                                      k_m = (fabs.f64 k)
                                      (FPCore (t l k_m)
                                       :precision binary64
                                       (let* ((t_1 (* (* (cos k_m) l) 2.0)) (t_2 (pow (sin k_m) 2.0)))
                                         (if (<= k_m 8.5e-132)
                                           (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                           (if (<= k_m 8.5e+144)
                                             (/ (* (/ t_1 t) (/ l (* k_m k_m))) t_2)
                                             (/ (* (/ t_1 (* k_m t)) (/ l k_m)) t_2)))))
                                      k_m = fabs(k);
                                      double code(double t, double l, double k_m) {
                                      	double t_1 = (cos(k_m) * l) * 2.0;
                                      	double t_2 = pow(sin(k_m), 2.0);
                                      	double tmp;
                                      	if (k_m <= 8.5e-132) {
                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                      	} else if (k_m <= 8.5e+144) {
                                      		tmp = ((t_1 / t) * (l / (k_m * k_m))) / t_2;
                                      	} else {
                                      		tmp = ((t_1 / (k_m * t)) * (l / k_m)) / t_2;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      k_m =     private
                                      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(t, l, k_m)
                                      use fmin_fmax_functions
                                          real(8), intent (in) :: t
                                          real(8), intent (in) :: l
                                          real(8), intent (in) :: k_m
                                          real(8) :: t_1
                                          real(8) :: t_2
                                          real(8) :: tmp
                                          t_1 = (cos(k_m) * l) * 2.0d0
                                          t_2 = sin(k_m) ** 2.0d0
                                          if (k_m <= 8.5d-132) then
                                              tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                          else if (k_m <= 8.5d+144) then
                                              tmp = ((t_1 / t) * (l / (k_m * k_m))) / t_2
                                          else
                                              tmp = ((t_1 / (k_m * t)) * (l / k_m)) / t_2
                                          end if
                                          code = tmp
                                      end function
                                      
                                      k_m = Math.abs(k);
                                      public static double code(double t, double l, double k_m) {
                                      	double t_1 = (Math.cos(k_m) * l) * 2.0;
                                      	double t_2 = Math.pow(Math.sin(k_m), 2.0);
                                      	double tmp;
                                      	if (k_m <= 8.5e-132) {
                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                      	} else if (k_m <= 8.5e+144) {
                                      		tmp = ((t_1 / t) * (l / (k_m * k_m))) / t_2;
                                      	} else {
                                      		tmp = ((t_1 / (k_m * t)) * (l / k_m)) / t_2;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      k_m = math.fabs(k)
                                      def code(t, l, k_m):
                                      	t_1 = (math.cos(k_m) * l) * 2.0
                                      	t_2 = math.pow(math.sin(k_m), 2.0)
                                      	tmp = 0
                                      	if k_m <= 8.5e-132:
                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                      	elif k_m <= 8.5e+144:
                                      		tmp = ((t_1 / t) * (l / (k_m * k_m))) / t_2
                                      	else:
                                      		tmp = ((t_1 / (k_m * t)) * (l / k_m)) / t_2
                                      	return tmp
                                      
                                      k_m = abs(k)
                                      function code(t, l, k_m)
                                      	t_1 = Float64(Float64(cos(k_m) * l) * 2.0)
                                      	t_2 = sin(k_m) ^ 2.0
                                      	tmp = 0.0
                                      	if (k_m <= 8.5e-132)
                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                      	elseif (k_m <= 8.5e+144)
                                      		tmp = Float64(Float64(Float64(t_1 / t) * Float64(l / Float64(k_m * k_m))) / t_2);
                                      	else
                                      		tmp = Float64(Float64(Float64(t_1 / Float64(k_m * t)) * Float64(l / k_m)) / t_2);
                                      	end
                                      	return tmp
                                      end
                                      
                                      k_m = abs(k);
                                      function tmp_2 = code(t, l, k_m)
                                      	t_1 = (cos(k_m) * l) * 2.0;
                                      	t_2 = sin(k_m) ^ 2.0;
                                      	tmp = 0.0;
                                      	if (k_m <= 8.5e-132)
                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                      	elseif (k_m <= 8.5e+144)
                                      		tmp = ((t_1 / t) * (l / (k_m * k_m))) / t_2;
                                      	else
                                      		tmp = ((t_1 / (k_m * t)) * (l / k_m)) / t_2;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      k_m = N[Abs[k], $MachinePrecision]
                                      code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 8.5e-132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 8.5e+144], N[(N[(N[(t$95$1 / t), $MachinePrecision] * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[(t$95$1 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]]]]]
                                      
                                      \begin{array}{l}
                                      k_m = \left|k\right|
                                      
                                      \\
                                      \begin{array}{l}
                                      t_1 := \left(\cos k\_m \cdot \ell\right) \cdot 2\\
                                      t_2 := {\sin k\_m}^{2}\\
                                      \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-132}:\\
                                      \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                      
                                      \mathbf{elif}\;k\_m \leq 8.5 \cdot 10^{+144}:\\
                                      \;\;\;\;\frac{\frac{t\_1}{t} \cdot \frac{\ell}{k\_m \cdot k\_m}}{t\_2}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\frac{\frac{t\_1}{k\_m \cdot t} \cdot \frac{\ell}{k\_m}}{t\_2}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if k < 8.49999999999999988e-132

                                        1. Initial program 36.3%

                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in t around 0

                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites73.9%

                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                          2. Taylor expanded in k around 0

                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites77.0%

                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                            2. Step-by-step derivation
                                              1. Applied rewrites81.2%

                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites81.3%

                                                  \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                if 8.49999999999999988e-132 < k < 8.4999999999999998e144

                                                1. Initial program 27.9%

                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in t around 0

                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                4. Step-by-step derivation
                                                  1. Applied rewrites75.7%

                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                  2. Taylor expanded in t around 0

                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites87.7%

                                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites95.5%

                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites97.6%

                                                          \[\leadsto \frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k \cdot k}}{\color{blue}{{\sin k}^{2}}} \]

                                                        if 8.4999999999999998e144 < k

                                                        1. Initial program 33.4%

                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in t around 0

                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites48.7%

                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                          2. Taylor expanded in t around 0

                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites68.2%

                                                              \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites52.9%

                                                                \[\leadsto \frac{\left(\left(\cos k \cdot \ell\right) \cdot \frac{\frac{\frac{2}{k}}{k}}{t}\right) \cdot \ell}{\color{blue}{{\sin k}^{2}}} \]
                                                              2. Step-by-step derivation
                                                                1. Applied rewrites83.8%

                                                                  \[\leadsto \frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k \cdot t} \cdot \frac{\ell}{k}}{{\color{blue}{\sin k}}^{2}} \]
                                                              3. Recombined 3 regimes into one program.
                                                              4. Final simplification85.2%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 8.5 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k \cdot k}}{{\sin k}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{k \cdot t} \cdot \frac{\ell}{k}}{{\sin k}^{2}}\\ \end{array} \]
                                                              5. Add Preprocessing

                                                              Alternative 4: 95.2% accurate, 1.3× speedup?

                                                              \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := {\sin k\_m}^{2}\\ \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 8.4 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{\left(\cos k\_m \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k\_m \cdot k\_m}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{2}{k\_m} \cdot \ell\right) \cdot \cos k\_m\right) \cdot \frac{\ell}{t\_1 \cdot \left(k\_m \cdot t\right)}\\ \end{array} \end{array} \]
                                                              k_m = (fabs.f64 k)
                                                              (FPCore (t l k_m)
                                                               :precision binary64
                                                               (let* ((t_1 (pow (sin k_m) 2.0)))
                                                                 (if (<= k_m 8.5e-132)
                                                                   (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                   (if (<= k_m 8.4e+144)
                                                                     (/ (* (/ (* (* (cos k_m) l) 2.0) t) (/ l (* k_m k_m))) t_1)
                                                                     (* (* (* (/ 2.0 k_m) l) (cos k_m)) (/ l (* t_1 (* k_m t))))))))
                                                              k_m = fabs(k);
                                                              double code(double t, double l, double k_m) {
                                                              	double t_1 = pow(sin(k_m), 2.0);
                                                              	double tmp;
                                                              	if (k_m <= 8.5e-132) {
                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                              	} else if (k_m <= 8.4e+144) {
                                                              		tmp = ((((cos(k_m) * l) * 2.0) / t) * (l / (k_m * k_m))) / t_1;
                                                              	} else {
                                                              		tmp = (((2.0 / k_m) * l) * cos(k_m)) * (l / (t_1 * (k_m * t)));
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              k_m =     private
                                                              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(t, l, k_m)
                                                              use fmin_fmax_functions
                                                                  real(8), intent (in) :: t
                                                                  real(8), intent (in) :: l
                                                                  real(8), intent (in) :: k_m
                                                                  real(8) :: t_1
                                                                  real(8) :: tmp
                                                                  t_1 = sin(k_m) ** 2.0d0
                                                                  if (k_m <= 8.5d-132) then
                                                                      tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                  else if (k_m <= 8.4d+144) then
                                                                      tmp = ((((cos(k_m) * l) * 2.0d0) / t) * (l / (k_m * k_m))) / t_1
                                                                  else
                                                                      tmp = (((2.0d0 / k_m) * l) * cos(k_m)) * (l / (t_1 * (k_m * t)))
                                                                  end if
                                                                  code = tmp
                                                              end function
                                                              
                                                              k_m = Math.abs(k);
                                                              public static double code(double t, double l, double k_m) {
                                                              	double t_1 = Math.pow(Math.sin(k_m), 2.0);
                                                              	double tmp;
                                                              	if (k_m <= 8.5e-132) {
                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                              	} else if (k_m <= 8.4e+144) {
                                                              		tmp = ((((Math.cos(k_m) * l) * 2.0) / t) * (l / (k_m * k_m))) / t_1;
                                                              	} else {
                                                              		tmp = (((2.0 / k_m) * l) * Math.cos(k_m)) * (l / (t_1 * (k_m * t)));
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              k_m = math.fabs(k)
                                                              def code(t, l, k_m):
                                                              	t_1 = math.pow(math.sin(k_m), 2.0)
                                                              	tmp = 0
                                                              	if k_m <= 8.5e-132:
                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                              	elif k_m <= 8.4e+144:
                                                              		tmp = ((((math.cos(k_m) * l) * 2.0) / t) * (l / (k_m * k_m))) / t_1
                                                              	else:
                                                              		tmp = (((2.0 / k_m) * l) * math.cos(k_m)) * (l / (t_1 * (k_m * t)))
                                                              	return tmp
                                                              
                                                              k_m = abs(k)
                                                              function code(t, l, k_m)
                                                              	t_1 = sin(k_m) ^ 2.0
                                                              	tmp = 0.0
                                                              	if (k_m <= 8.5e-132)
                                                              		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                              	elseif (k_m <= 8.4e+144)
                                                              		tmp = Float64(Float64(Float64(Float64(Float64(cos(k_m) * l) * 2.0) / t) * Float64(l / Float64(k_m * k_m))) / t_1);
                                                              	else
                                                              		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * l) * cos(k_m)) * Float64(l / Float64(t_1 * Float64(k_m * t))));
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              k_m = abs(k);
                                                              function tmp_2 = code(t, l, k_m)
                                                              	t_1 = sin(k_m) ^ 2.0;
                                                              	tmp = 0.0;
                                                              	if (k_m <= 8.5e-132)
                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                              	elseif (k_m <= 8.4e+144)
                                                              		tmp = ((((cos(k_m) * l) * 2.0) / t) * (l / (k_m * k_m))) / t_1;
                                                              	else
                                                              		tmp = (((2.0 / k_m) * l) * cos(k_m)) * (l / (t_1 * (k_m * t)));
                                                              	end
                                                              	tmp_2 = tmp;
                                                              end
                                                              
                                                              k_m = N[Abs[k], $MachinePrecision]
                                                              code[t_, l_, k$95$m_] := Block[{t$95$1 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 8.5e-132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 8.4e+144], N[(N[(N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * 2.0), $MachinePrecision] / t), $MachinePrecision] * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$1 * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                              
                                                              \begin{array}{l}
                                                              k_m = \left|k\right|
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              t_1 := {\sin k\_m}^{2}\\
                                                              \mathbf{if}\;k\_m \leq 8.5 \cdot 10^{-132}:\\
                                                              \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                              
                                                              \mathbf{elif}\;k\_m \leq 8.4 \cdot 10^{+144}:\\
                                                              \;\;\;\;\frac{\frac{\left(\cos k\_m \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k\_m \cdot k\_m}}{t\_1}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;\left(\left(\frac{2}{k\_m} \cdot \ell\right) \cdot \cos k\_m\right) \cdot \frac{\ell}{t\_1 \cdot \left(k\_m \cdot t\right)}\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if k < 8.49999999999999988e-132

                                                                1. Initial program 36.3%

                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                2. Add Preprocessing
                                                                3. Taylor expanded in t around 0

                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites73.9%

                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                  2. Taylor expanded in k around 0

                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites77.0%

                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                    2. Step-by-step derivation
                                                                      1. Applied rewrites81.2%

                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites81.3%

                                                                          \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                        if 8.49999999999999988e-132 < k < 8.39999999999999985e144

                                                                        1. Initial program 27.9%

                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in t around 0

                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                        4. Step-by-step derivation
                                                                          1. Applied rewrites75.7%

                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                          2. Taylor expanded in t around 0

                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites87.7%

                                                                              \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                            2. Step-by-step derivation
                                                                              1. Applied rewrites95.5%

                                                                                \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                              2. Step-by-step derivation
                                                                                1. Applied rewrites97.6%

                                                                                  \[\leadsto \frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k \cdot k}}{\color{blue}{{\sin k}^{2}}} \]

                                                                                if 8.39999999999999985e144 < k

                                                                                1. Initial program 33.4%

                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                2. Add Preprocessing
                                                                                3. Taylor expanded in t around 0

                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                4. Step-by-step derivation
                                                                                  1. Applied rewrites48.7%

                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                  2. Taylor expanded in t around 0

                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites68.2%

                                                                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                    2. Step-by-step derivation
                                                                                      1. Applied rewrites81.0%

                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                      2. Step-by-step derivation
                                                                                        1. Applied rewrites83.6%

                                                                                          \[\leadsto \left(\left(\frac{2}{k} \cdot \ell\right) \cdot \cos k\right) \cdot \color{blue}{\frac{\ell}{{\sin k}^{2} \cdot \left(k \cdot t\right)}} \]
                                                                                      3. Recombined 3 regimes into one program.
                                                                                      4. Final simplification85.1%

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8.5 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 8.4 \cdot 10^{+144}:\\ \;\;\;\;\frac{\frac{\left(\cos k \cdot \ell\right) \cdot 2}{t} \cdot \frac{\ell}{k \cdot k}}{{\sin k}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{2}{k} \cdot \ell\right) \cdot \cos k\right) \cdot \frac{\ell}{{\sin k}^{2} \cdot \left(k \cdot t\right)}\\ \end{array} \]
                                                                                      5. Add Preprocessing

                                                                                      Alternative 5: 95.3% accurate, 1.3× speedup?

                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := {\sin k\_m}^{2}\\ \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 3.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot \frac{\ell}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{2}{k\_m} \cdot \ell\right) \cdot \cos k\_m\right) \cdot \frac{\ell}{t\_1 \cdot \left(k\_m \cdot t\right)}\\ \end{array} \end{array} \]
                                                                                      k_m = (fabs.f64 k)
                                                                                      (FPCore (t l k_m)
                                                                                       :precision binary64
                                                                                       (let* ((t_1 (pow (sin k_m) 2.0)))
                                                                                         (if (<= k_m 7.8e-140)
                                                                                           (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                           (if (<= k_m 3.6e-5)
                                                                                             (* (/ (/ (* l (fma (- k_m) k_m 2.0)) t) (* k_m k_m)) (/ l t_1))
                                                                                             (* (* (* (/ 2.0 k_m) l) (cos k_m)) (/ l (* t_1 (* k_m t))))))))
                                                                                      k_m = fabs(k);
                                                                                      double code(double t, double l, double k_m) {
                                                                                      	double t_1 = pow(sin(k_m), 2.0);
                                                                                      	double tmp;
                                                                                      	if (k_m <= 7.8e-140) {
                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                      	} else if (k_m <= 3.6e-5) {
                                                                                      		tmp = (((l * fma(-k_m, k_m, 2.0)) / t) / (k_m * k_m)) * (l / t_1);
                                                                                      	} else {
                                                                                      		tmp = (((2.0 / k_m) * l) * cos(k_m)) * (l / (t_1 * (k_m * t)));
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      k_m = abs(k)
                                                                                      function code(t, l, k_m)
                                                                                      	t_1 = sin(k_m) ^ 2.0
                                                                                      	tmp = 0.0
                                                                                      	if (k_m <= 7.8e-140)
                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                      	elseif (k_m <= 3.6e-5)
                                                                                      		tmp = Float64(Float64(Float64(Float64(l * fma(Float64(-k_m), k_m, 2.0)) / t) / Float64(k_m * k_m)) * Float64(l / t_1));
                                                                                      	else
                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * l) * cos(k_m)) * Float64(l / Float64(t_1 * Float64(k_m * t))));
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                      code[t_, l_, k$95$m_] := Block[{t$95$1 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 7.8e-140], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3.6e-5], N[(N[(N[(N[(l * N[((-k$95$m) * k$95$m + 2.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * l), $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(l / N[(t$95$1 * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      k_m = \left|k\right|
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      t_1 := {\sin k\_m}^{2}\\
                                                                                      \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\
                                                                                      \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                      
                                                                                      \mathbf{elif}\;k\_m \leq 3.6 \cdot 10^{-5}:\\
                                                                                      \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot \frac{\ell}{t\_1}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\left(\left(\frac{2}{k\_m} \cdot \ell\right) \cdot \cos k\_m\right) \cdot \frac{\ell}{t\_1 \cdot \left(k\_m \cdot t\right)}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 3 regimes
                                                                                      2. if k < 7.80000000000000038e-140

                                                                                        1. Initial program 35.1%

                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in t around 0

                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites73.4%

                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                          2. Taylor expanded in k around 0

                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites76.6%

                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                            2. Step-by-step derivation
                                                                                              1. Applied rewrites80.9%

                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                              2. Step-by-step derivation
                                                                                                1. Applied rewrites80.9%

                                                                                                  \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                if 7.80000000000000038e-140 < k < 3.60000000000000009e-5

                                                                                                1. Initial program 36.0%

                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in t around 0

                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. Applied rewrites81.7%

                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                  2. Taylor expanded in t around 0

                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites91.0%

                                                                                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                    2. Step-by-step derivation
                                                                                                      1. Applied rewrites97.3%

                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                      2. Taylor expanded in k around 0

                                                                                                        \[\leadsto \frac{-1 \cdot \frac{{k}^{2} \cdot \ell}{t} + 2 \cdot \frac{\ell}{t}}{{k}^{2}} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites99.7%

                                                                                                          \[\leadsto \frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]

                                                                                                        if 3.60000000000000009e-5 < k

                                                                                                        1. Initial program 30.3%

                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                        2. Add Preprocessing
                                                                                                        3. Taylor expanded in t around 0

                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                        4. Step-by-step derivation
                                                                                                          1. Applied rewrites58.6%

                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                          2. Taylor expanded in t around 0

                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                          3. Step-by-step derivation
                                                                                                            1. Applied rewrites75.8%

                                                                                                              \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                            2. Step-by-step derivation
                                                                                                              1. Applied rewrites86.7%

                                                                                                                \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                              2. Step-by-step derivation
                                                                                                                1. Applied rewrites89.0%

                                                                                                                  \[\leadsto \left(\left(\frac{2}{k} \cdot \ell\right) \cdot \cos k\right) \cdot \color{blue}{\frac{\ell}{{\sin k}^{2} \cdot \left(k \cdot t\right)}} \]
                                                                                                              3. Recombined 3 regimes into one program.
                                                                                                              4. Final simplification85.2%

                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 3.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\ell}{{\sin k}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{2}{k} \cdot \ell\right) \cdot \cos k\right) \cdot \frac{\ell}{{\sin k}^{2} \cdot \left(k \cdot t\right)}\\ \end{array} \]
                                                                                                              5. Add Preprocessing

                                                                                                              Alternative 6: 94.7% accurate, 1.3× speedup?

                                                                                                              \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\ \end{array} \end{array} \]
                                                                                                              k_m = (fabs.f64 k)
                                                                                                              (FPCore (t l k_m)
                                                                                                               :precision binary64
                                                                                                               (if (<= k_m 1.3e-132)
                                                                                                                 (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                 (*
                                                                                                                  (/ (* (/ 2.0 k_m) (* (cos k_m) l)) (* k_m t))
                                                                                                                  (/ l (pow (sin k_m) 2.0)))))
                                                                                                              k_m = fabs(k);
                                                                                                              double code(double t, double l, double k_m) {
                                                                                                              	double tmp;
                                                                                                              	if (k_m <= 1.3e-132) {
                                                                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                              	} else {
                                                                                                              		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / pow(sin(k_m), 2.0));
                                                                                                              	}
                                                                                                              	return tmp;
                                                                                                              }
                                                                                                              
                                                                                                              k_m =     private
                                                                                                              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(t, l, k_m)
                                                                                                              use fmin_fmax_functions
                                                                                                                  real(8), intent (in) :: t
                                                                                                                  real(8), intent (in) :: l
                                                                                                                  real(8), intent (in) :: k_m
                                                                                                                  real(8) :: tmp
                                                                                                                  if (k_m <= 1.3d-132) then
                                                                                                                      tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                  else
                                                                                                                      tmp = (((2.0d0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (sin(k_m) ** 2.0d0))
                                                                                                                  end if
                                                                                                                  code = tmp
                                                                                                              end function
                                                                                                              
                                                                                                              k_m = Math.abs(k);
                                                                                                              public static double code(double t, double l, double k_m) {
                                                                                                              	double tmp;
                                                                                                              	if (k_m <= 1.3e-132) {
                                                                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                              	} else {
                                                                                                              		tmp = (((2.0 / k_m) * (Math.cos(k_m) * l)) / (k_m * t)) * (l / Math.pow(Math.sin(k_m), 2.0));
                                                                                                              	}
                                                                                                              	return tmp;
                                                                                                              }
                                                                                                              
                                                                                                              k_m = math.fabs(k)
                                                                                                              def code(t, l, k_m):
                                                                                                              	tmp = 0
                                                                                                              	if k_m <= 1.3e-132:
                                                                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                              	else:
                                                                                                              		tmp = (((2.0 / k_m) * (math.cos(k_m) * l)) / (k_m * t)) * (l / math.pow(math.sin(k_m), 2.0))
                                                                                                              	return tmp
                                                                                                              
                                                                                                              k_m = abs(k)
                                                                                                              function code(t, l, k_m)
                                                                                                              	tmp = 0.0
                                                                                                              	if (k_m <= 1.3e-132)
                                                                                                              		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                              	else
                                                                                                              		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * Float64(cos(k_m) * l)) / Float64(k_m * t)) * Float64(l / (sin(k_m) ^ 2.0)));
                                                                                                              	end
                                                                                                              	return tmp
                                                                                                              end
                                                                                                              
                                                                                                              k_m = abs(k);
                                                                                                              function tmp_2 = code(t, l, k_m)
                                                                                                              	tmp = 0.0;
                                                                                                              	if (k_m <= 1.3e-132)
                                                                                                              		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                              	else
                                                                                                              		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (sin(k_m) ^ 2.0));
                                                                                                              	end
                                                                                                              	tmp_2 = tmp;
                                                                                                              end
                                                                                                              
                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                              code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.3e-132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                              
                                                                                                              \begin{array}{l}
                                                                                                              k_m = \left|k\right|
                                                                                                              
                                                                                                              \\
                                                                                                              \begin{array}{l}
                                                                                                              \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\
                                                                                                              \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                              
                                                                                                              \mathbf{else}:\\
                                                                                                              \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                              
                                                                                                              
                                                                                                              \end{array}
                                                                                                              \end{array}
                                                                                                              
                                                                                                              Derivation
                                                                                                              1. Split input into 2 regimes
                                                                                                              2. if k < 1.3e-132

                                                                                                                1. Initial program 36.3%

                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                2. Add Preprocessing
                                                                                                                3. Taylor expanded in t around 0

                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. Applied rewrites73.9%

                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites77.0%

                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                    2. Step-by-step derivation
                                                                                                                      1. Applied rewrites81.2%

                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                      2. Step-by-step derivation
                                                                                                                        1. Applied rewrites81.3%

                                                                                                                          \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                        if 1.3e-132 < k

                                                                                                                        1. Initial program 30.0%

                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. Applied rewrites65.5%

                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                          2. Taylor expanded in t around 0

                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites80.4%

                                                                                                                              \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                            2. Step-by-step derivation
                                                                                                                              1. Applied rewrites90.0%

                                                                                                                                \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                            3. Recombined 2 regimes into one program.
                                                                                                                            4. Final simplification84.3%

                                                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\\ \end{array} \]
                                                                                                                            5. Add Preprocessing

                                                                                                                            Alternative 7: 94.2% accurate, 1.7× speedup?

                                                                                                                            \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 0.0028:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)}\\ \end{array} \end{array} \]
                                                                                                                            k_m = (fabs.f64 k)
                                                                                                                            (FPCore (t l k_m)
                                                                                                                             :precision binary64
                                                                                                                             (if (<= k_m 7.8e-140)
                                                                                                                               (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                               (if (<= k_m 0.0028)
                                                                                                                                 (*
                                                                                                                                  (/ (/ (* l (fma (- k_m) k_m 2.0)) t) (* k_m k_m))
                                                                                                                                  (/ l (pow (sin k_m) 2.0)))
                                                                                                                                 (*
                                                                                                                                  (/ (* (/ 2.0 k_m) (* (cos k_m) l)) (* k_m t))
                                                                                                                                  (/ l (- 0.5 (* 0.5 (cos (* 2.0 k_m)))))))))
                                                                                                                            k_m = fabs(k);
                                                                                                                            double code(double t, double l, double k_m) {
                                                                                                                            	double tmp;
                                                                                                                            	if (k_m <= 7.8e-140) {
                                                                                                                            		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                            	} else if (k_m <= 0.0028) {
                                                                                                                            		tmp = (((l * fma(-k_m, k_m, 2.0)) / t) / (k_m * k_m)) * (l / pow(sin(k_m), 2.0));
                                                                                                                            	} else {
                                                                                                                            		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (0.5 - (0.5 * cos((2.0 * k_m)))));
                                                                                                                            	}
                                                                                                                            	return tmp;
                                                                                                                            }
                                                                                                                            
                                                                                                                            k_m = abs(k)
                                                                                                                            function code(t, l, k_m)
                                                                                                                            	tmp = 0.0
                                                                                                                            	if (k_m <= 7.8e-140)
                                                                                                                            		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                            	elseif (k_m <= 0.0028)
                                                                                                                            		tmp = Float64(Float64(Float64(Float64(l * fma(Float64(-k_m), k_m, 2.0)) / t) / Float64(k_m * k_m)) * Float64(l / (sin(k_m) ^ 2.0)));
                                                                                                                            	else
                                                                                                                            		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * Float64(cos(k_m) * l)) / Float64(k_m * t)) * Float64(l / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m))))));
                                                                                                                            	end
                                                                                                                            	return tmp
                                                                                                                            end
                                                                                                                            
                                                                                                                            k_m = N[Abs[k], $MachinePrecision]
                                                                                                                            code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 7.8e-140], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 0.0028], N[(N[(N[(N[(l * N[((-k$95$m) * k$95$m + 2.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                            
                                                                                                                            \begin{array}{l}
                                                                                                                            k_m = \left|k\right|
                                                                                                                            
                                                                                                                            \\
                                                                                                                            \begin{array}{l}
                                                                                                                            \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\
                                                                                                                            \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                            
                                                                                                                            \mathbf{elif}\;k\_m \leq 0.0028:\\
                                                                                                                            \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                                            
                                                                                                                            \mathbf{else}:\\
                                                                                                                            \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)}\\
                                                                                                                            
                                                                                                                            
                                                                                                                            \end{array}
                                                                                                                            \end{array}
                                                                                                                            
                                                                                                                            Derivation
                                                                                                                            1. Split input into 3 regimes
                                                                                                                            2. if k < 7.80000000000000038e-140

                                                                                                                              1. Initial program 35.1%

                                                                                                                                \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                              2. Add Preprocessing
                                                                                                                              3. Taylor expanded in t around 0

                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                              4. Step-by-step derivation
                                                                                                                                1. Applied rewrites73.4%

                                                                                                                                  \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                2. Taylor expanded in k around 0

                                                                                                                                  \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                3. Step-by-step derivation
                                                                                                                                  1. Applied rewrites76.6%

                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                  2. Step-by-step derivation
                                                                                                                                    1. Applied rewrites80.9%

                                                                                                                                      \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                    2. Step-by-step derivation
                                                                                                                                      1. Applied rewrites80.9%

                                                                                                                                        \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                      if 7.80000000000000038e-140 < k < 0.00279999999999999997

                                                                                                                                      1. Initial program 36.0%

                                                                                                                                        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                      2. Add Preprocessing
                                                                                                                                      3. Taylor expanded in t around 0

                                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                      4. Step-by-step derivation
                                                                                                                                        1. Applied rewrites81.7%

                                                                                                                                          \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                        2. Taylor expanded in t around 0

                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                        3. Step-by-step derivation
                                                                                                                                          1. Applied rewrites91.0%

                                                                                                                                            \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                          2. Step-by-step derivation
                                                                                                                                            1. Applied rewrites97.3%

                                                                                                                                              \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                            2. Taylor expanded in k around 0

                                                                                                                                              \[\leadsto \frac{-1 \cdot \frac{{k}^{2} \cdot \ell}{t} + 2 \cdot \frac{\ell}{t}}{{k}^{2}} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites99.7%

                                                                                                                                                \[\leadsto \frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]

                                                                                                                                              if 0.00279999999999999997 < k

                                                                                                                                              1. Initial program 30.3%

                                                                                                                                                \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                              2. Add Preprocessing
                                                                                                                                              3. Taylor expanded in t around 0

                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                1. Applied rewrites58.6%

                                                                                                                                                  \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                2. Taylor expanded in t around 0

                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites75.8%

                                                                                                                                                    \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites86.7%

                                                                                                                                                      \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                      1. Applied rewrites86.6%

                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{0.5 - \color{blue}{0.5 \cdot \cos \left(2 \cdot k\right)}} \]
                                                                                                                                                    3. Recombined 3 regimes into one program.
                                                                                                                                                    4. Final simplification84.6%

                                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 0.0028:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\ell}{{\sin k}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\ \end{array} \]
                                                                                                                                                    5. Add Preprocessing

                                                                                                                                                    Alternative 8: 85.4% accurate, 1.7× speedup?

                                                                                                                                                    \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\ell}{{\sin k\_m}^{2}}\\ \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 0.028:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot t\_1\\ \mathbf{elif}\;k\_m \leq 7.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{2 \cdot \left(\left(\cos k\_m \cdot \ell\right) \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot t\_1\\ \end{array} \end{array} \]
                                                                                                                                                    k_m = (fabs.f64 k)
                                                                                                                                                    (FPCore (t l k_m)
                                                                                                                                                     :precision binary64
                                                                                                                                                     (let* ((t_1 (/ l (pow (sin k_m) 2.0))))
                                                                                                                                                       (if (<= k_m 7.8e-140)
                                                                                                                                                         (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                         (if (<= k_m 0.028)
                                                                                                                                                           (* (/ (/ (* l (fma (- k_m) k_m 2.0)) t) (* k_m k_m)) t_1)
                                                                                                                                                           (if (<= k_m 7.2e+144)
                                                                                                                                                             (/
                                                                                                                                                              (* 2.0 (* (* (cos k_m) l) l))
                                                                                                                                                              (* (* (* k_m k_m) t) (- 0.5 (* 0.5 (cos (* 2.0 k_m))))))
                                                                                                                                                             (* (/ (* (/ 2.0 k_m) l) (* k_m t)) t_1))))))
                                                                                                                                                    k_m = fabs(k);
                                                                                                                                                    double code(double t, double l, double k_m) {
                                                                                                                                                    	double t_1 = l / pow(sin(k_m), 2.0);
                                                                                                                                                    	double tmp;
                                                                                                                                                    	if (k_m <= 7.8e-140) {
                                                                                                                                                    		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                    	} else if (k_m <= 0.028) {
                                                                                                                                                    		tmp = (((l * fma(-k_m, k_m, 2.0)) / t) / (k_m * k_m)) * t_1;
                                                                                                                                                    	} else if (k_m <= 7.2e+144) {
                                                                                                                                                    		tmp = (2.0 * ((cos(k_m) * l) * l)) / (((k_m * k_m) * t) * (0.5 - (0.5 * cos((2.0 * k_m)))));
                                                                                                                                                    	} else {
                                                                                                                                                    		tmp = (((2.0 / k_m) * l) / (k_m * t)) * t_1;
                                                                                                                                                    	}
                                                                                                                                                    	return tmp;
                                                                                                                                                    }
                                                                                                                                                    
                                                                                                                                                    k_m = abs(k)
                                                                                                                                                    function code(t, l, k_m)
                                                                                                                                                    	t_1 = Float64(l / (sin(k_m) ^ 2.0))
                                                                                                                                                    	tmp = 0.0
                                                                                                                                                    	if (k_m <= 7.8e-140)
                                                                                                                                                    		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                    	elseif (k_m <= 0.028)
                                                                                                                                                    		tmp = Float64(Float64(Float64(Float64(l * fma(Float64(-k_m), k_m, 2.0)) / t) / Float64(k_m * k_m)) * t_1);
                                                                                                                                                    	elseif (k_m <= 7.2e+144)
                                                                                                                                                    		tmp = Float64(Float64(2.0 * Float64(Float64(cos(k_m) * l) * l)) / Float64(Float64(Float64(k_m * k_m) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m))))));
                                                                                                                                                    	else
                                                                                                                                                    		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * l) / Float64(k_m * t)) * t_1);
                                                                                                                                                    	end
                                                                                                                                                    	return tmp
                                                                                                                                                    end
                                                                                                                                                    
                                                                                                                                                    k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                    code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 7.8e-140], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 0.028], N[(N[(N[(N[(l * N[((-k$95$m) * k$95$m + 2.0), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[k$95$m, 7.2e+144], N[(N[(2.0 * N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
                                                                                                                                                    
                                                                                                                                                    \begin{array}{l}
                                                                                                                                                    k_m = \left|k\right|
                                                                                                                                                    
                                                                                                                                                    \\
                                                                                                                                                    \begin{array}{l}
                                                                                                                                                    t_1 := \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                                                                    \mathbf{if}\;k\_m \leq 7.8 \cdot 10^{-140}:\\
                                                                                                                                                    \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                    
                                                                                                                                                    \mathbf{elif}\;k\_m \leq 0.028:\\
                                                                                                                                                    \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k\_m, k\_m, 2\right)}{t}}{k\_m \cdot k\_m} \cdot t\_1\\
                                                                                                                                                    
                                                                                                                                                    \mathbf{elif}\;k\_m \leq 7.2 \cdot 10^{+144}:\\
                                                                                                                                                    \;\;\;\;\frac{2 \cdot \left(\left(\cos k\_m \cdot \ell\right) \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right)}\\
                                                                                                                                                    
                                                                                                                                                    \mathbf{else}:\\
                                                                                                                                                    \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot t\_1\\
                                                                                                                                                    
                                                                                                                                                    
                                                                                                                                                    \end{array}
                                                                                                                                                    \end{array}
                                                                                                                                                    
                                                                                                                                                    Derivation
                                                                                                                                                    1. Split input into 4 regimes
                                                                                                                                                    2. if k < 7.80000000000000038e-140

                                                                                                                                                      1. Initial program 35.1%

                                                                                                                                                        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                      3. Taylor expanded in t around 0

                                                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites73.4%

                                                                                                                                                          \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                        2. Taylor expanded in k around 0

                                                                                                                                                          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites76.6%

                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites80.9%

                                                                                                                                                              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites80.9%

                                                                                                                                                                \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                              if 7.80000000000000038e-140 < k < 0.0280000000000000006

                                                                                                                                                              1. Initial program 36.0%

                                                                                                                                                                \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                              2. Add Preprocessing
                                                                                                                                                              3. Taylor expanded in t around 0

                                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites81.7%

                                                                                                                                                                  \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                2. Taylor expanded in t around 0

                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites91.0%

                                                                                                                                                                    \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites97.3%

                                                                                                                                                                      \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                    2. Taylor expanded in k around 0

                                                                                                                                                                      \[\leadsto \frac{-1 \cdot \frac{{k}^{2} \cdot \ell}{t} + 2 \cdot \frac{\ell}{t}}{{k}^{2}} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites99.7%

                                                                                                                                                                        \[\leadsto \frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]

                                                                                                                                                                      if 0.0280000000000000006 < k < 7.1999999999999995e144

                                                                                                                                                                      1. Initial program 27.3%

                                                                                                                                                                        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                                      3. Taylor expanded in t around 0

                                                                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites73.9%

                                                                                                                                                                          \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                          1. Applied rewrites73.9%

                                                                                                                                                                            \[\leadsto \frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\color{blue}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin k}^{2}}} \]
                                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                                            1. Applied rewrites73.9%

                                                                                                                                                                              \[\leadsto \frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - \color{blue}{0.5 \cdot \cos \left(2 \cdot k\right)}\right)} \]

                                                                                                                                                                            if 7.1999999999999995e144 < k

                                                                                                                                                                            1. Initial program 32.5%

                                                                                                                                                                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                            3. Taylor expanded in t around 0

                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                              1. Applied rewrites47.3%

                                                                                                                                                                                \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                              2. Taylor expanded in t around 0

                                                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                1. Applied rewrites66.3%

                                                                                                                                                                                  \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                  1. Applied rewrites78.8%

                                                                                                                                                                                    \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                    \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                    1. Applied rewrites55.6%

                                                                                                                                                                                      \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                  4. Recombined 4 regimes into one program.
                                                                                                                                                                                  5. Final simplification79.1%

                                                                                                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 7.8 \cdot 10^{-140}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 0.028:\\ \;\;\;\;\frac{\frac{\ell \cdot \mathsf{fma}\left(-k, k, 2\right)}{t}}{k \cdot k} \cdot \frac{\ell}{{\sin k}^{2}}\\ \mathbf{elif}\;k \leq 7.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\\ \end{array} \]
                                                                                                                                                                                  6. Add Preprocessing

                                                                                                                                                                                  Alternative 9: 85.0% accurate, 1.7× speedup?

                                                                                                                                                                                  \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \cos k\_m \cdot \ell\\ \mathbf{if}\;k\_m \leq 0.028:\\ \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot t\_1\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\ \mathbf{elif}\;k\_m \leq 7.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\ \end{array} \end{array} \]
                                                                                                                                                                                  k_m = (fabs.f64 k)
                                                                                                                                                                                  (FPCore (t l k_m)
                                                                                                                                                                                   :precision binary64
                                                                                                                                                                                   (let* ((t_1 (* (cos k_m) l)))
                                                                                                                                                                                     (if (<= k_m 0.028)
                                                                                                                                                                                       (*
                                                                                                                                                                                        (* (/ (/ 2.0 k_m) (* k_m t)) t_1)
                                                                                                                                                                                        (/ (/ (fma 0.3333333333333333 (* (* k_m k_m) l) l) k_m) k_m))
                                                                                                                                                                                       (if (<= k_m 7.2e+144)
                                                                                                                                                                                         (/
                                                                                                                                                                                          (* 2.0 (* t_1 l))
                                                                                                                                                                                          (* (* (* k_m k_m) t) (- 0.5 (* 0.5 (cos (* 2.0 k_m))))))
                                                                                                                                                                                         (* (/ (* (/ 2.0 k_m) l) (* k_m t)) (/ l (pow (sin k_m) 2.0)))))))
                                                                                                                                                                                  k_m = fabs(k);
                                                                                                                                                                                  double code(double t, double l, double k_m) {
                                                                                                                                                                                  	double t_1 = cos(k_m) * l;
                                                                                                                                                                                  	double tmp;
                                                                                                                                                                                  	if (k_m <= 0.028) {
                                                                                                                                                                                  		tmp = (((2.0 / k_m) / (k_m * t)) * t_1) * ((fma(0.3333333333333333, ((k_m * k_m) * l), l) / k_m) / k_m);
                                                                                                                                                                                  	} else if (k_m <= 7.2e+144) {
                                                                                                                                                                                  		tmp = (2.0 * (t_1 * l)) / (((k_m * k_m) * t) * (0.5 - (0.5 * cos((2.0 * k_m)))));
                                                                                                                                                                                  	} else {
                                                                                                                                                                                  		tmp = (((2.0 / k_m) * l) / (k_m * t)) * (l / pow(sin(k_m), 2.0));
                                                                                                                                                                                  	}
                                                                                                                                                                                  	return tmp;
                                                                                                                                                                                  }
                                                                                                                                                                                  
                                                                                                                                                                                  k_m = abs(k)
                                                                                                                                                                                  function code(t, l, k_m)
                                                                                                                                                                                  	t_1 = Float64(cos(k_m) * l)
                                                                                                                                                                                  	tmp = 0.0
                                                                                                                                                                                  	if (k_m <= 0.028)
                                                                                                                                                                                  		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / Float64(k_m * t)) * t_1) * Float64(Float64(fma(0.3333333333333333, Float64(Float64(k_m * k_m) * l), l) / k_m) / k_m));
                                                                                                                                                                                  	elseif (k_m <= 7.2e+144)
                                                                                                                                                                                  		tmp = Float64(Float64(2.0 * Float64(t_1 * l)) / Float64(Float64(Float64(k_m * k_m) * t) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m))))));
                                                                                                                                                                                  	else
                                                                                                                                                                                  		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * l) / Float64(k_m * t)) * Float64(l / (sin(k_m) ^ 2.0)));
                                                                                                                                                                                  	end
                                                                                                                                                                                  	return tmp
                                                                                                                                                                                  end
                                                                                                                                                                                  
                                                                                                                                                                                  k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                  code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]}, If[LessEqual[k$95$m, 0.028], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] * N[(N[(N[(0.3333333333333333 * N[(N[(k$95$m * k$95$m), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 7.2e+144], N[(N[(2.0 * N[(t$95$1 * l), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                                                                                                                                  
                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                  k_m = \left|k\right|
                                                                                                                                                                                  
                                                                                                                                                                                  \\
                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                  t_1 := \cos k\_m \cdot \ell\\
                                                                                                                                                                                  \mathbf{if}\;k\_m \leq 0.028:\\
                                                                                                                                                                                  \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot t\_1\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\
                                                                                                                                                                                  
                                                                                                                                                                                  \mathbf{elif}\;k\_m \leq 7.2 \cdot 10^{+144}:\\
                                                                                                                                                                                  \;\;\;\;\frac{2 \cdot \left(t\_1 \cdot \ell\right)}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right)}\\
                                                                                                                                                                                  
                                                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                                                  \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                                                                                                  
                                                                                                                                                                                  
                                                                                                                                                                                  \end{array}
                                                                                                                                                                                  \end{array}
                                                                                                                                                                                  
                                                                                                                                                                                  Derivation
                                                                                                                                                                                  1. Split input into 3 regimes
                                                                                                                                                                                  2. if k < 0.0280000000000000006

                                                                                                                                                                                    1. Initial program 35.3%

                                                                                                                                                                                      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                                    3. Taylor expanded in t around 0

                                                                                                                                                                                      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                                      1. Applied rewrites74.8%

                                                                                                                                                                                        \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                      2. Taylor expanded in t around 0

                                                                                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                        1. Applied rewrites89.8%

                                                                                                                                                                                          \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                        2. Taylor expanded in k around 0

                                                                                                                                                                                          \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell + \frac{1}{3} \cdot \left({k}^{2} \cdot \ell\right)}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                          1. Applied rewrites79.6%

                                                                                                                                                                                            \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{\color{blue}{k}} \]

                                                                                                                                                                                          if 0.0280000000000000006 < k < 7.1999999999999995e144

                                                                                                                                                                                          1. Initial program 27.3%

                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                            1. Applied rewrites73.9%

                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                              1. Applied rewrites73.9%

                                                                                                                                                                                                \[\leadsto \frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\color{blue}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin k}^{2}}} \]
                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                1. Applied rewrites73.9%

                                                                                                                                                                                                  \[\leadsto \frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - \color{blue}{0.5 \cdot \cos \left(2 \cdot k\right)}\right)} \]

                                                                                                                                                                                                if 7.1999999999999995e144 < k

                                                                                                                                                                                                1. Initial program 32.5%

                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                  1. Applied rewrites47.3%

                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                  2. Taylor expanded in t around 0

                                                                                                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                    1. Applied rewrites66.3%

                                                                                                                                                                                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                      1. Applied rewrites78.8%

                                                                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                      2. Taylor expanded in k around 0

                                                                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                        1. Applied rewrites55.6%

                                                                                                                                                                                                          \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                                      4. Recombined 3 regimes into one program.
                                                                                                                                                                                                      5. Final simplification75.7%

                                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 0.028:\\ \;\;\;\;\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{k}\\ \mathbf{elif}\;k \leq 7.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{2 \cdot \left(\left(\cos k \cdot \ell\right) \cdot \ell\right)}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\\ \end{array} \]
                                                                                                                                                                                                      6. Add Preprocessing

                                                                                                                                                                                                      Alternative 10: 79.1% accurate, 1.8× speedup?

                                                                                                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5.3 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\ \end{array} \end{array} \]
                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                      (FPCore (t l k_m)
                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                       (if (<= k_m 5.3e+132)
                                                                                                                                                                                                         (*
                                                                                                                                                                                                          (* (/ (/ 2.0 k_m) (* k_m t)) (* (cos k_m) l))
                                                                                                                                                                                                          (/ (/ (fma 0.3333333333333333 (* (* k_m k_m) l) l) k_m) k_m))
                                                                                                                                                                                                         (* (/ (* (/ 2.0 k_m) l) (* k_m t)) (/ l (pow (sin k_m) 2.0)))))
                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                      	if (k_m <= 5.3e+132) {
                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / (k_m * t)) * (cos(k_m) * l)) * ((fma(0.3333333333333333, ((k_m * k_m) * l), l) / k_m) / k_m);
                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                      		tmp = (((2.0 / k_m) * l) / (k_m * t)) * (l / pow(sin(k_m), 2.0));
                                                                                                                                                                                                      	}
                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                      }
                                                                                                                                                                                                      
                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                      function code(t, l, k_m)
                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                      	if (k_m <= 5.3e+132)
                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / Float64(k_m * t)) * Float64(cos(k_m) * l)) * Float64(Float64(fma(0.3333333333333333, Float64(Float64(k_m * k_m) * l), l) / k_m) / k_m));
                                                                                                                                                                                                      	else
                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * l) / Float64(k_m * t)) * Float64(l / (sin(k_m) ^ 2.0)));
                                                                                                                                                                                                      	end
                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                      end
                                                                                                                                                                                                      
                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.3e+132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.3333333333333333 * N[(N[(k$95$m * k$95$m), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * l), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                                                                      
                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                      
                                                                                                                                                                                                      \\
                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                      \mathbf{if}\;k\_m \leq 5.3 \cdot 10^{+132}:\\
                                                                                                                                                                                                      \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\
                                                                                                                                                                                                      
                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                      \;\;\;\;\frac{\frac{2}{k\_m} \cdot \ell}{k\_m \cdot t} \cdot \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                                                                                                                      
                                                                                                                                                                                                      
                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                      
                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                      2. if k < 5.3e132

                                                                                                                                                                                                        1. Initial program 34.3%

                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                          1. Applied rewrites74.7%

                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                          2. Taylor expanded in t around 0

                                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                            1. Applied rewrites89.6%

                                                                                                                                                                                                              \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                            2. Taylor expanded in k around 0

                                                                                                                                                                                                              \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell + \frac{1}{3} \cdot \left({k}^{2} \cdot \ell\right)}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                              1. Applied rewrites75.9%

                                                                                                                                                                                                                \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{\color{blue}{k}} \]

                                                                                                                                                                                                              if 5.3e132 < k

                                                                                                                                                                                                              1. Initial program 32.5%

                                                                                                                                                                                                                \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                              2. Add Preprocessing
                                                                                                                                                                                                              3. Taylor expanded in t around 0

                                                                                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                                                                1. Applied rewrites47.3%

                                                                                                                                                                                                                  \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                2. Taylor expanded in t around 0

                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                  1. Applied rewrites66.3%

                                                                                                                                                                                                                    \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                    1. Applied rewrites78.8%

                                                                                                                                                                                                                      \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                                    2. Taylor expanded in k around 0

                                                                                                                                                                                                                      \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                      1. Applied rewrites55.6%

                                                                                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}} \]
                                                                                                                                                                                                                    4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                    5. Final simplification73.2%

                                                                                                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.3 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \ell}{k \cdot t} \cdot \frac{\ell}{{\sin k}^{2}}\\ \end{array} \]
                                                                                                                                                                                                                    6. Add Preprocessing

                                                                                                                                                                                                                    Alternative 11: 78.9% accurate, 1.8× speedup?

                                                                                                                                                                                                                    \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5.3 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell}{\left(k\_m \cdot t\right) \cdot k\_m} \cdot 2\right) \cdot \frac{\ell}{{\sin k\_m}^{2}}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                    k_m = (fabs.f64 k)
                                                                                                                                                                                                                    (FPCore (t l k_m)
                                                                                                                                                                                                                     :precision binary64
                                                                                                                                                                                                                     (if (<= k_m 5.3e+132)
                                                                                                                                                                                                                       (*
                                                                                                                                                                                                                        (* (/ (/ 2.0 k_m) (* k_m t)) (* (cos k_m) l))
                                                                                                                                                                                                                        (/ (/ (fma 0.3333333333333333 (* (* k_m k_m) l) l) k_m) k_m))
                                                                                                                                                                                                                       (* (* (/ l (* (* k_m t) k_m)) 2.0) (/ l (pow (sin k_m) 2.0)))))
                                                                                                                                                                                                                    k_m = fabs(k);
                                                                                                                                                                                                                    double code(double t, double l, double k_m) {
                                                                                                                                                                                                                    	double tmp;
                                                                                                                                                                                                                    	if (k_m <= 5.3e+132) {
                                                                                                                                                                                                                    		tmp = (((2.0 / k_m) / (k_m * t)) * (cos(k_m) * l)) * ((fma(0.3333333333333333, ((k_m * k_m) * l), l) / k_m) / k_m);
                                                                                                                                                                                                                    	} else {
                                                                                                                                                                                                                    		tmp = ((l / ((k_m * t) * k_m)) * 2.0) * (l / pow(sin(k_m), 2.0));
                                                                                                                                                                                                                    	}
                                                                                                                                                                                                                    	return tmp;
                                                                                                                                                                                                                    }
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    k_m = abs(k)
                                                                                                                                                                                                                    function code(t, l, k_m)
                                                                                                                                                                                                                    	tmp = 0.0
                                                                                                                                                                                                                    	if (k_m <= 5.3e+132)
                                                                                                                                                                                                                    		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / Float64(k_m * t)) * Float64(cos(k_m) * l)) * Float64(Float64(fma(0.3333333333333333, Float64(Float64(k_m * k_m) * l), l) / k_m) / k_m));
                                                                                                                                                                                                                    	else
                                                                                                                                                                                                                    		tmp = Float64(Float64(Float64(l / Float64(Float64(k_m * t) * k_m)) * 2.0) * Float64(l / (sin(k_m) ^ 2.0)));
                                                                                                                                                                                                                    	end
                                                                                                                                                                                                                    	return tmp
                                                                                                                                                                                                                    end
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                    code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.3e+132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.3333333333333333 * N[(N[(k$95$m * k$95$m), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / N[(N[(k$95$m * t), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[(l / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \begin{array}{l}
                                                                                                                                                                                                                    k_m = \left|k\right|
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \\
                                                                                                                                                                                                                    \begin{array}{l}
                                                                                                                                                                                                                    \mathbf{if}\;k\_m \leq 5.3 \cdot 10^{+132}:\\
                                                                                                                                                                                                                    \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \mathbf{else}:\\
                                                                                                                                                                                                                    \;\;\;\;\left(\frac{\ell}{\left(k\_m \cdot t\right) \cdot k\_m} \cdot 2\right) \cdot \frac{\ell}{{\sin k\_m}^{2}}\\
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    \end{array}
                                                                                                                                                                                                                    \end{array}
                                                                                                                                                                                                                    
                                                                                                                                                                                                                    Derivation
                                                                                                                                                                                                                    1. Split input into 2 regimes
                                                                                                                                                                                                                    2. if k < 5.3e132

                                                                                                                                                                                                                      1. Initial program 34.3%

                                                                                                                                                                                                                        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                                                                                      3. Taylor expanded in t around 0

                                                                                                                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                                                                                        1. Applied rewrites74.7%

                                                                                                                                                                                                                          \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                        2. Taylor expanded in t around 0

                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                          1. Applied rewrites89.6%

                                                                                                                                                                                                                            \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                            \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell + \frac{1}{3} \cdot \left({k}^{2} \cdot \ell\right)}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                            1. Applied rewrites75.9%

                                                                                                                                                                                                                              \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{\color{blue}{k}} \]

                                                                                                                                                                                                                            if 5.3e132 < k

                                                                                                                                                                                                                            1. Initial program 32.5%

                                                                                                                                                                                                                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                                            3. Taylor expanded in t around 0

                                                                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                                                                              1. Applied rewrites47.3%

                                                                                                                                                                                                                                \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                              2. Taylor expanded in t around 0

                                                                                                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                1. Applied rewrites66.3%

                                                                                                                                                                                                                                  \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                2. Taylor expanded in k around 0

                                                                                                                                                                                                                                  \[\leadsto \left(2 \cdot \frac{\ell}{{k}^{2} \cdot t}\right) \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                  1. Applied rewrites54.8%

                                                                                                                                                                                                                                    \[\leadsto \left(\frac{\ell}{\left(k \cdot t\right) \cdot k} \cdot 2\right) \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                                                4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                5. Final simplification73.1%

                                                                                                                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.3 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell}{\left(k \cdot t\right) \cdot k} \cdot 2\right) \cdot \frac{\ell}{{\sin k}^{2}}\\ \end{array} \]
                                                                                                                                                                                                                                6. Add Preprocessing

                                                                                                                                                                                                                                Alternative 12: 79.3% accurate, 2.5× speedup?

                                                                                                                                                                                                                                \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 1.65 \cdot 10^{+133}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m \cdot k\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                k_m = (fabs.f64 k)
                                                                                                                                                                                                                                (FPCore (t l k_m)
                                                                                                                                                                                                                                 :precision binary64
                                                                                                                                                                                                                                 (if (<= k_m 1.3e-132)
                                                                                                                                                                                                                                   (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                   (if (<= k_m 1.65e+133)
                                                                                                                                                                                                                                     (*
                                                                                                                                                                                                                                      (/ (* (/ 2.0 k_m) (* (cos k_m) l)) (* k_m t))
                                                                                                                                                                                                                                      (/ (fma 0.3333333333333333 (* (* k_m k_m) l) l) (* k_m k_m)))
                                                                                                                                                                                                                                     (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                k_m = fabs(k);
                                                                                                                                                                                                                                double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                	double tmp;
                                                                                                                                                                                                                                	if (k_m <= 1.3e-132) {
                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                	} else if (k_m <= 1.65e+133) {
                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (fma(0.3333333333333333, ((k_m * k_m) * l), l) / (k_m * k_m));
                                                                                                                                                                                                                                	} else {
                                                                                                                                                                                                                                		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                	}
                                                                                                                                                                                                                                	return tmp;
                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                k_m = abs(k)
                                                                                                                                                                                                                                function code(t, l, k_m)
                                                                                                                                                                                                                                	tmp = 0.0
                                                                                                                                                                                                                                	if (k_m <= 1.3e-132)
                                                                                                                                                                                                                                		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                	elseif (k_m <= 1.65e+133)
                                                                                                                                                                                                                                		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * Float64(cos(k_m) * l)) / Float64(k_m * t)) * Float64(fma(0.3333333333333333, Float64(Float64(k_m * k_m) * l), l) / Float64(k_m * k_m)));
                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                	end
                                                                                                                                                                                                                                	return tmp
                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.3e-132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.65e+133], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(N[(0.3333333333333333 * N[(N[(k$95$m * k$95$m), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                                                                                k_m = \left|k\right|
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                \\
                                                                                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                                                                                \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\
                                                                                                                                                                                                                                \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                \mathbf{elif}\;k\_m \leq 1.65 \cdot 10^{+133}:\\
                                                                                                                                                                                                                                \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m \cdot k\_m}\\
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                                                                                                \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                \end{array}
                                                                                                                                                                                                                                \end{array}
                                                                                                                                                                                                                                
                                                                                                                                                                                                                                Derivation
                                                                                                                                                                                                                                1. Split input into 3 regimes
                                                                                                                                                                                                                                2. if k < 1.3e-132

                                                                                                                                                                                                                                  1. Initial program 36.3%

                                                                                                                                                                                                                                    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                  2. Add Preprocessing
                                                                                                                                                                                                                                  3. Taylor expanded in t around 0

                                                                                                                                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                                                                                    1. Applied rewrites73.9%

                                                                                                                                                                                                                                      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                    2. Taylor expanded in k around 0

                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                      1. Applied rewrites77.0%

                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                        1. Applied rewrites81.2%

                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                          1. Applied rewrites81.3%

                                                                                                                                                                                                                                            \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                          if 1.3e-132 < k < 1.65e133

                                                                                                                                                                                                                                          1. Initial program 28.4%

                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                            1. Applied rewrites77.0%

                                                                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                            2. Taylor expanded in t around 0

                                                                                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                              1. Applied rewrites89.3%

                                                                                                                                                                                                                                                \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                1. Applied rewrites97.1%

                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                                                                2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell + \frac{1}{3} \cdot \left({k}^{2} \cdot \ell\right)}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                                  1. Applied rewrites74.5%

                                                                                                                                                                                                                                                    \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{\color{blue}{k \cdot k}} \]

                                                                                                                                                                                                                                                  if 1.65e133 < k

                                                                                                                                                                                                                                                  1. Initial program 32.5%

                                                                                                                                                                                                                                                    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                  2. Add Preprocessing
                                                                                                                                                                                                                                                  3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                                                                                                    1. Applied rewrites47.3%

                                                                                                                                                                                                                                                      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                    2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                                      1. Applied rewrites51.4%

                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                        1. Applied rewrites51.4%

                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                          1. Applied rewrites53.8%

                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                        3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                        4. Final simplification76.1%

                                                                                                                                                                                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 1.65 \cdot 10^{+133}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                        5. Add Preprocessing

                                                                                                                                                                                                                                                        Alternative 13: 78.5% accurate, 2.5× speedup?

                                                                                                                                                                                                                                                        \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 8 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                        k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                        (FPCore (t l k_m)
                                                                                                                                                                                                                                                         :precision binary64
                                                                                                                                                                                                                                                         (if (<= k_m 8e+132)
                                                                                                                                                                                                                                                           (*
                                                                                                                                                                                                                                                            (* (/ (/ 2.0 k_m) (* k_m t)) (* (cos k_m) l))
                                                                                                                                                                                                                                                            (/ (/ (fma 0.3333333333333333 (* (* k_m k_m) l) l) k_m) k_m))
                                                                                                                                                                                                                                                           (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m))))
                                                                                                                                                                                                                                                        k_m = fabs(k);
                                                                                                                                                                                                                                                        double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                        	double tmp;
                                                                                                                                                                                                                                                        	if (k_m <= 8e+132) {
                                                                                                                                                                                                                                                        		tmp = (((2.0 / k_m) / (k_m * t)) * (cos(k_m) * l)) * ((fma(0.3333333333333333, ((k_m * k_m) * l), l) / k_m) / k_m);
                                                                                                                                                                                                                                                        	} else {
                                                                                                                                                                                                                                                        		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                        	}
                                                                                                                                                                                                                                                        	return tmp;
                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        k_m = abs(k)
                                                                                                                                                                                                                                                        function code(t, l, k_m)
                                                                                                                                                                                                                                                        	tmp = 0.0
                                                                                                                                                                                                                                                        	if (k_m <= 8e+132)
                                                                                                                                                                                                                                                        		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / Float64(k_m * t)) * Float64(cos(k_m) * l)) * Float64(Float64(fma(0.3333333333333333, Float64(Float64(k_m * k_m) * l), l) / k_m) / k_m));
                                                                                                                                                                                                                                                        	else
                                                                                                                                                                                                                                                        		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                        	end
                                                                                                                                                                                                                                                        	return tmp
                                                                                                                                                                                                                                                        end
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                        code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 8e+132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(0.3333333333333333 * N[(N[(k$95$m * k$95$m), $MachinePrecision] * l), $MachinePrecision] + l), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                                                        k_m = \left|k\right|
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        \\
                                                                                                                                                                                                                                                        \begin{array}{l}
                                                                                                                                                                                                                                                        \mathbf{if}\;k\_m \leq 8 \cdot 10^{+132}:\\
                                                                                                                                                                                                                                                        \;\;\;\;\left(\frac{\frac{2}{k\_m}}{k\_m \cdot t} \cdot \left(\cos k\_m \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k\_m \cdot k\_m\right) \cdot \ell, \ell\right)}{k\_m}}{k\_m}\\
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        \mathbf{else}:\\
                                                                                                                                                                                                                                                        \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                                                        \end{array}
                                                                                                                                                                                                                                                        
                                                                                                                                                                                                                                                        Derivation
                                                                                                                                                                                                                                                        1. Split input into 2 regimes
                                                                                                                                                                                                                                                        2. if k < 7.99999999999999993e132

                                                                                                                                                                                                                                                          1. Initial program 34.3%

                                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                                            1. Applied rewrites74.7%

                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                            2. Taylor expanded in t around 0

                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                              1. Applied rewrites89.6%

                                                                                                                                                                                                                                                                \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                              2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell + \frac{1}{3} \cdot \left({k}^{2} \cdot \ell\right)}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                1. Applied rewrites75.9%

                                                                                                                                                                                                                                                                  \[\leadsto \left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{\color{blue}{k}} \]

                                                                                                                                                                                                                                                                if 7.99999999999999993e132 < k

                                                                                                                                                                                                                                                                1. Initial program 32.5%

                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                  1. Applied rewrites47.3%

                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                    1. Applied rewrites51.4%

                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                      1. Applied rewrites51.4%

                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                        1. Applied rewrites53.8%

                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                      4. Final simplification72.9%

                                                                                                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 8 \cdot 10^{+132}:\\ \;\;\;\;\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\frac{\mathsf{fma}\left(0.3333333333333333, \left(k \cdot k\right) \cdot \ell, \ell\right)}{k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                                                                                                                      Alternative 14: 77.4% accurate, 2.7× speedup?

                                                                                                                                                                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 3.9 \cdot 10^{+99}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{k\_m \cdot k\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                      (FPCore (t l k_m)
                                                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                                                       (if (<= k_m 1.3e-132)
                                                                                                                                                                                                                                                                         (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                         (if (<= k_m 3.9e+99)
                                                                                                                                                                                                                                                                           (* (/ (* (/ 2.0 k_m) (* (cos k_m) l)) (* k_m t)) (/ l (* k_m k_m)))
                                                                                                                                                                                                                                                                           (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                      	if (k_m <= 1.3e-132) {
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                      	} else if (k_m <= 3.9e+99) {
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (k_m * k_m));
                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m =     private
                                                                                                                                                                                                                                                                      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(t, l, k_m)
                                                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                                                          real(8), intent (in) :: t
                                                                                                                                                                                                                                                                          real(8), intent (in) :: l
                                                                                                                                                                                                                                                                          real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                                                                                                                          if (k_m <= 1.3d-132) then
                                                                                                                                                                                                                                                                              tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                          else if (k_m <= 3.9d+99) then
                                                                                                                                                                                                                                                                              tmp = (((2.0d0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (k_m * k_m))
                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                              tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                          end if
                                                                                                                                                                                                                                                                          code = tmp
                                                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m = Math.abs(k);
                                                                                                                                                                                                                                                                      public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                      	if (k_m <= 1.3e-132) {
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                      	} else if (k_m <= 3.9e+99) {
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) * (Math.cos(k_m) * l)) / (k_m * t)) * (l / (k_m * k_m));
                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m = math.fabs(k)
                                                                                                                                                                                                                                                                      def code(t, l, k_m):
                                                                                                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                                                                                                      	if k_m <= 1.3e-132:
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                      	elif k_m <= 3.9e+99:
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) * (math.cos(k_m) * l)) / (k_m * t)) * (l / (k_m * k_m))
                                                                                                                                                                                                                                                                      	else:
                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                                                                                      function code(t, l, k_m)
                                                                                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                                                                                      	if (k_m <= 1.3e-132)
                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                      	elseif (k_m <= 3.9e+99)
                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) * Float64(cos(k_m) * l)) / Float64(k_m * t)) * Float64(l / Float64(k_m * k_m)));
                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m = abs(k);
                                                                                                                                                                                                                                                                      function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                                                                                                                      	if (k_m <= 1.3e-132)
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                      	elseif (k_m <= 3.9e+99)
                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) * (cos(k_m) * l)) / (k_m * t)) * (l / (k_m * k_m));
                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.3e-132], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 3.9e+99], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                      \mathbf{if}\;k\_m \leq 1.3 \cdot 10^{-132}:\\
                                                                                                                                                                                                                                                                      \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      \mathbf{elif}\;k\_m \leq 3.9 \cdot 10^{+99}:\\
                                                                                                                                                                                                                                                                      \;\;\;\;\frac{\frac{2}{k\_m} \cdot \left(\cos k\_m \cdot \ell\right)}{k\_m \cdot t} \cdot \frac{\ell}{k\_m \cdot k\_m}\\
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                                                                                      \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                      1. Split input into 3 regimes
                                                                                                                                                                                                                                                                      2. if k < 1.3e-132

                                                                                                                                                                                                                                                                        1. Initial program 36.3%

                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                          1. Applied rewrites73.9%

                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                            1. Applied rewrites77.0%

                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                              1. Applied rewrites81.2%

                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                1. Applied rewrites81.3%

                                                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                if 1.3e-132 < k < 3.89999999999999995e99

                                                                                                                                                                                                                                                                                1. Initial program 25.1%

                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                  1. Applied rewrites78.7%

                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                  2. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                    1. Applied rewrites89.2%

                                                                                                                                                                                                                                                                                      \[\leadsto \color{blue}{\left(\frac{\frac{2}{k}}{k \cdot t} \cdot \left(\cos k \cdot \ell\right)\right) \cdot \frac{\ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                      1. Applied rewrites96.8%

                                                                                                                                                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\color{blue}{\ell}}{{\sin k}^{2}} \]
                                                                                                                                                                                                                                                                                      2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                        \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                        1. Applied rewrites73.7%

                                                                                                                                                                                                                                                                                          \[\leadsto \frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{\color{blue}{k \cdot k}} \]

                                                                                                                                                                                                                                                                                        if 3.89999999999999995e99 < k

                                                                                                                                                                                                                                                                                        1. Initial program 35.1%

                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                          1. Applied rewrites51.6%

                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                            1. Applied rewrites48.1%

                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                              1. Applied rewrites48.1%

                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                1. Applied rewrites54.4%

                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                              3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                                                              4. Final simplification75.3%

                                                                                                                                                                                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.3 \cdot 10^{-132}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 3.9 \cdot 10^{+99}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot \left(\cos k \cdot \ell\right)}{k \cdot t} \cdot \frac{\ell}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                              5. Add Preprocessing

                                                                                                                                                                                                                                                                                              Alternative 15: 77.3% accurate, 2.8× speedup?

                                                                                                                                                                                                                                                                                              \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot {\left(\frac{\ell}{k\_m}\right)}^{2}}{k\_m \cdot t}\\ \mathbf{elif}\;k\_m \leq 0.4:\\ \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \frac{k\_m \cdot k\_m}{\left(\cos k\_m \cdot \ell\right) \cdot \ell}}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                              k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                              (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                               :precision binary64
                                                                                                                                                                                                                                                                                               (if (<= k_m 1.5e-79)
                                                                                                                                                                                                                                                                                                 (/ (* (/ 2.0 k_m) (pow (/ l k_m) 2.0)) (* k_m t))
                                                                                                                                                                                                                                                                                                 (if (<= k_m 0.4)
                                                                                                                                                                                                                                                                                                   (/ 2.0 (* (/ (pow k_m 4.0) l) (/ t l)))
                                                                                                                                                                                                                                                                                                   (/ 2.0 (* (* (* k_m k_m) t) (/ (* k_m k_m) (* (* (cos k_m) l) l)))))))
                                                                                                                                                                                                                                                                                              k_m = fabs(k);
                                                                                                                                                                                                                                                                                              double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                              	double tmp;
                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * pow((l / k_m), 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                              	} else if (k_m <= 0.4) {
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m * k_m) * t) * ((k_m * k_m) / ((cos(k_m) * l) * l)));
                                                                                                                                                                                                                                                                                              	}
                                                                                                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m =     private
                                                                                                                                                                                                                                                                                              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(t, l, k_m)
                                                                                                                                                                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                  real(8) :: tmp
                                                                                                                                                                                                                                                                                                  if (k_m <= 1.5d-79) then
                                                                                                                                                                                                                                                                                                      tmp = ((2.0d0 / k_m) * ((l / k_m) ** 2.0d0)) / (k_m * t)
                                                                                                                                                                                                                                                                                                  else if (k_m <= 0.4d0) then
                                                                                                                                                                                                                                                                                                      tmp = 2.0d0 / (((k_m ** 4.0d0) / l) * (t / l))
                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                      tmp = 2.0d0 / (((k_m * k_m) * t) * ((k_m * k_m) / ((cos(k_m) * l) * l)))
                                                                                                                                                                                                                                                                                                  end if
                                                                                                                                                                                                                                                                                                  code = tmp
                                                                                                                                                                                                                                                                                              end function
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                              public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                              	double tmp;
                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * Math.pow((l / k_m), 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                              	} else if (k_m <= 0.4) {
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((Math.pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m * k_m) * t) * ((k_m * k_m) / ((Math.cos(k_m) * l) * l)));
                                                                                                                                                                                                                                                                                              	}
                                                                                                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                              def code(t, l, k_m):
                                                                                                                                                                                                                                                                                              	tmp = 0
                                                                                                                                                                                                                                                                                              	if k_m <= 1.5e-79:
                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * math.pow((l / k_m), 2.0)) / (k_m * t)
                                                                                                                                                                                                                                                                                              	elif k_m <= 0.4:
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((math.pow(k_m, 4.0) / l) * (t / l))
                                                                                                                                                                                                                                                                                              	else:
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m * k_m) * t) * ((k_m * k_m) / ((math.cos(k_m) * l) * l)))
                                                                                                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m = abs(k)
                                                                                                                                                                                                                                                                                              function code(t, l, k_m)
                                                                                                                                                                                                                                                                                              	tmp = 0.0
                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                              		tmp = Float64(Float64(Float64(2.0 / k_m) * (Float64(l / k_m) ^ 2.0)) / Float64(k_m * t));
                                                                                                                                                                                                                                                                                              	elseif (k_m <= 0.4)
                                                                                                                                                                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64((k_m ^ 4.0) / l) * Float64(t / l)));
                                                                                                                                                                                                                                                                                              	else
                                                                                                                                                                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * t) * Float64(Float64(k_m * k_m) / Float64(Float64(cos(k_m) * l) * l))));
                                                                                                                                                                                                                                                                                              	end
                                                                                                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m = abs(k);
                                                                                                                                                                                                                                                                                              function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                              	tmp = 0.0;
                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * ((l / k_m) ^ 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                              	elseif (k_m <= 0.4)
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m ^ 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                              	else
                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m * k_m) * t) * ((k_m * k_m) / ((cos(k_m) * l) * l)));
                                                                                                                                                                                                                                                                                              	end
                                                                                                                                                                                                                                                                                              	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                              code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.5e-79], N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 0.4], N[(2.0 / N[(N[(N[Power[k$95$m, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(N[(N[Cos[k$95$m], $MachinePrecision] * l), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                                                                              k_m = \left|k\right|
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                                                                              \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\
                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{\frac{2}{k\_m} \cdot {\left(\frac{\ell}{k\_m}\right)}^{2}}{k\_m \cdot t}\\
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              \mathbf{elif}\;k\_m \leq 0.4:\\
                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              \mathbf{else}:\\
                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot \frac{k\_m \cdot k\_m}{\left(\cos k\_m \cdot \ell\right) \cdot \ell}}\\
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                                                                                                              1. Split input into 3 regimes
                                                                                                                                                                                                                                                                                              2. if k < 1.5e-79

                                                                                                                                                                                                                                                                                                1. Initial program 36.3%

                                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                  1. Applied rewrites74.3%

                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                    1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                      1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                        1. Applied rewrites82.3%

                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{\color{blue}{k \cdot t}} \]

                                                                                                                                                                                                                                                                                                        if 1.5e-79 < k < 0.40000000000000002

                                                                                                                                                                                                                                                                                                        1. Initial program 23.0%

                                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                                        3. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
                                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                          1. Applied rewrites99.5%

                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}} \]

                                                                                                                                                                                                                                                                                                          if 0.40000000000000002 < k

                                                                                                                                                                                                                                                                                                          1. Initial program 30.3%

                                                                                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}{{\ell}^{2} \cdot \cos k}}} \]
                                                                                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                            1. Applied rewrites58.6%

                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \frac{{\sin k}^{2}}{\ell \cdot \ell}}} \]
                                                                                                                                                                                                                                                                                                            2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \frac{{k}^{2}}{\color{blue}{\ell} \cdot \ell}} \]
                                                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                              1. Applied rewrites46.6%

                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot t}{\cos k} \cdot \frac{k \cdot k}{\color{blue}{\ell} \cdot \ell}} \]
                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                1. Applied rewrites46.6%

                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \color{blue}{\frac{k \cdot k}{\left(\cos k \cdot \ell\right) \cdot \ell}}} \]
                                                                                                                                                                                                                                                                                                              3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                                                                              4. Final simplification74.8%

                                                                                                                                                                                                                                                                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{k \cdot t}\\ \mathbf{elif}\;k \leq 0.4:\\ \;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \frac{k \cdot k}{\left(\cos k \cdot \ell\right) \cdot \ell}}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                              5. Add Preprocessing

                                                                                                                                                                                                                                                                                                              Alternative 16: 75.8% accurate, 3.0× speedup?

                                                                                                                                                                                                                                                                                                              \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{2}{k\_m} \cdot {\left(\frac{\ell}{k\_m}\right)}^{2}}{k\_m \cdot t}\\ \mathbf{elif}\;k\_m \leq 5 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                              k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                              (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                               :precision binary64
                                                                                                                                                                                                                                                                                                               (if (<= k_m 1.5e-79)
                                                                                                                                                                                                                                                                                                                 (/ (* (/ 2.0 k_m) (pow (/ l k_m) 2.0)) (* k_m t))
                                                                                                                                                                                                                                                                                                                 (if (<= k_m 5e+41)
                                                                                                                                                                                                                                                                                                                   (/ 2.0 (* (/ (pow k_m 4.0) l) (/ t l)))
                                                                                                                                                                                                                                                                                                                   (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                                                                                              k_m = fabs(k);
                                                                                                                                                                                                                                                                                                              double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                              	double tmp;
                                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * pow((l / k_m), 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                                              	} else if (k_m <= 5e+41) {
                                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                                                                                                                              		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                              	}
                                                                                                                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m =     private
                                                                                                                                                                                                                                                                                                              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(t, l, k_m)
                                                                                                                                                                                                                                                                                                              use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                  real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                  real(8) :: tmp
                                                                                                                                                                                                                                                                                                                  if (k_m <= 1.5d-79) then
                                                                                                                                                                                                                                                                                                                      tmp = ((2.0d0 / k_m) * ((l / k_m) ** 2.0d0)) / (k_m * t)
                                                                                                                                                                                                                                                                                                                  else if (k_m <= 5d+41) then
                                                                                                                                                                                                                                                                                                                      tmp = 2.0d0 / (((k_m ** 4.0d0) / l) * (t / l))
                                                                                                                                                                                                                                                                                                                  else
                                                                                                                                                                                                                                                                                                                      tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                  end if
                                                                                                                                                                                                                                                                                                                  code = tmp
                                                                                                                                                                                                                                                                                                              end function
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                              public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                              	double tmp;
                                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * Math.pow((l / k_m), 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                                              	} else if (k_m <= 5e+41) {
                                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((Math.pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                                                                                                                              		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                              	}
                                                                                                                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                              def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                              	tmp = 0
                                                                                                                                                                                                                                                                                                              	if k_m <= 1.5e-79:
                                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * math.pow((l / k_m), 2.0)) / (k_m * t)
                                                                                                                                                                                                                                                                                                              	elif k_m <= 5e+41:
                                                                                                                                                                                                                                                                                                              		tmp = 2.0 / ((math.pow(k_m, 4.0) / l) * (t / l))
                                                                                                                                                                                                                                                                                                              	else:
                                                                                                                                                                                                                                                                                                              		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m = abs(k)
                                                                                                                                                                                                                                                                                                              function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                              	tmp = 0.0
                                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                              		tmp = Float64(Float64(Float64(2.0 / k_m) * (Float64(l / k_m) ^ 2.0)) / Float64(k_m * t));
                                                                                                                                                                                                                                                                                                              	elseif (k_m <= 5e+41)
                                                                                                                                                                                                                                                                                                              		tmp = Float64(2.0 / Float64(Float64((k_m ^ 4.0) / l) * Float64(t / l)));
                                                                                                                                                                                                                                                                                                              	else
                                                                                                                                                                                                                                                                                                              		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                              	end
                                                                                                                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m = abs(k);
                                                                                                                                                                                                                                                                                                              function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                              	tmp = 0.0;
                                                                                                                                                                                                                                                                                                              	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                              		tmp = ((2.0 / k_m) * ((l / k_m) ^ 2.0)) / (k_m * t);
                                                                                                                                                                                                                                                                                                              	elseif (k_m <= 5e+41)
                                                                                                                                                                                                                                                                                                              		tmp = 2.0 / (((k_m ^ 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                              	else
                                                                                                                                                                                                                                                                                                              		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                              	end
                                                                                                                                                                                                                                                                                                              	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                              end
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                              code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.5e-79], N[(N[(N[(2.0 / k$95$m), $MachinePrecision] * N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5e+41], N[(2.0 / N[(N[(N[Power[k$95$m, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                                                                                              k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              \\
                                                                                                                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                                                                                                                              \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\
                                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{\frac{2}{k\_m} \cdot {\left(\frac{\ell}{k\_m}\right)}^{2}}{k\_m \cdot t}\\
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              \mathbf{elif}\;k\_m \leq 5 \cdot 10^{+41}:\\
                                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                              \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                                                                                                                              1. Split input into 3 regimes
                                                                                                                                                                                                                                                                                                              2. if k < 1.5e-79

                                                                                                                                                                                                                                                                                                                1. Initial program 36.3%

                                                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                  1. Applied rewrites74.3%

                                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                    1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                      1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                        1. Applied rewrites82.3%

                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{\color{blue}{k \cdot t}} \]

                                                                                                                                                                                                                                                                                                                        if 1.5e-79 < k < 5.00000000000000022e41

                                                                                                                                                                                                                                                                                                                        1. Initial program 24.9%

                                                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                        3. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
                                                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                          1. Applied rewrites73.5%

                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}} \]

                                                                                                                                                                                                                                                                                                                          if 5.00000000000000022e41 < k

                                                                                                                                                                                                                                                                                                                          1. Initial program 30.5%

                                                                                                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                            1. Applied rewrites55.1%

                                                                                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                            2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                              1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites48.4%

                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                                                                                                4. Final simplification74.4%

                                                                                                                                                                                                                                                                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{2}{k} \cdot {\left(\frac{\ell}{k}\right)}^{2}}{k \cdot t}\\ \mathbf{elif}\;k \leq 5 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                Alternative 17: 75.2% accurate, 3.0× speedup?

                                                                                                                                                                                                                                                                                                                                \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 5 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                                                k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                 :precision binary64
                                                                                                                                                                                                                                                                                                                                 (if (<= k_m 1.5e-79)
                                                                                                                                                                                                                                                                                                                                   (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                                                                                   (if (<= k_m 5e+41)
                                                                                                                                                                                                                                                                                                                                     (/ 2.0 (* (/ (pow k_m 4.0) l) (/ t l)))
                                                                                                                                                                                                                                                                                                                                     (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                                                                                                                k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                	double tmp;
                                                                                                                                                                                                                                                                                                                                	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                	} else if (k_m <= 5e+41) {
                                                                                                                                                                                                                                                                                                                                		tmp = 2.0 / ((pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                                                	} else {
                                                                                                                                                                                                                                                                                                                                		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                	}
                                                                                                                                                                                                                                                                                                                                	return tmp;
                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m =     private
                                                                                                                                                                                                                                                                                                                                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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                    real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                    real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                    real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                    real(8) :: tmp
                                                                                                                                                                                                                                                                                                                                    if (k_m <= 1.5d-79) then
                                                                                                                                                                                                                                                                                                                                        tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                    else if (k_m <= 5d+41) then
                                                                                                                                                                                                                                                                                                                                        tmp = 2.0d0 / (((k_m ** 4.0d0) / l) * (t / l))
                                                                                                                                                                                                                                                                                                                                    else
                                                                                                                                                                                                                                                                                                                                        tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                    end if
                                                                                                                                                                                                                                                                                                                                    code = tmp
                                                                                                                                                                                                                                                                                                                                end function
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                	double tmp;
                                                                                                                                                                                                                                                                                                                                	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                	} else if (k_m <= 5e+41) {
                                                                                                                                                                                                                                                                                                                                		tmp = 2.0 / ((Math.pow(k_m, 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                                                	} else {
                                                                                                                                                                                                                                                                                                                                		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                	}
                                                                                                                                                                                                                                                                                                                                	return tmp;
                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                	tmp = 0
                                                                                                                                                                                                                                                                                                                                	if k_m <= 1.5e-79:
                                                                                                                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                	elif k_m <= 5e+41:
                                                                                                                                                                                                                                                                                                                                		tmp = 2.0 / ((math.pow(k_m, 4.0) / l) * (t / l))
                                                                                                                                                                                                                                                                                                                                	else:
                                                                                                                                                                                                                                                                                                                                		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                	return tmp
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                	tmp = 0.0
                                                                                                                                                                                                                                                                                                                                	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                                                		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                                                                                	elseif (k_m <= 5e+41)
                                                                                                                                                                                                                                                                                                                                		tmp = Float64(2.0 / Float64(Float64((k_m ^ 4.0) / l) * Float64(t / l)));
                                                                                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                                                                                		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                                                	end
                                                                                                                                                                                                                                                                                                                                	return tmp
                                                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                	tmp = 0.0;
                                                                                                                                                                                                                                                                                                                                	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                                                		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                	elseif (k_m <= 5e+41)
                                                                                                                                                                                                                                                                                                                                		tmp = 2.0 / (((k_m ^ 4.0) / l) * (t / l));
                                                                                                                                                                                                                                                                                                                                	else
                                                                                                                                                                                                                                                                                                                                		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                	end
                                                                                                                                                                                                                                                                                                                                	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                end
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.5e-79], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5e+41], N[(2.0 / N[(N[(N[Power[k$95$m, 4.0], $MachinePrecision] / l), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                \\
                                                                                                                                                                                                                                                                                                                                \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\
                                                                                                                                                                                                                                                                                                                                \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                \mathbf{elif}\;k\_m \leq 5 \cdot 10^{+41}:\\
                                                                                                                                                                                                                                                                                                                                \;\;\;\;\frac{2}{\frac{{k\_m}^{4}}{\ell} \cdot \frac{t}{\ell}}\\
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                \end{array}
                                                                                                                                                                                                                                                                                                                                \end{array}
                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                Derivation
                                                                                                                                                                                                                                                                                                                                1. Split input into 3 regimes
                                                                                                                                                                                                                                                                                                                                2. if k < 1.5e-79

                                                                                                                                                                                                                                                                                                                                  1. Initial program 36.3%

                                                                                                                                                                                                                                                                                                                                    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                  2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                  3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                  4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites74.3%

                                                                                                                                                                                                                                                                                                                                      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                    2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                                                                          if 1.5e-79 < k < 5.00000000000000022e41

                                                                                                                                                                                                                                                                                                                                          1. Initial program 24.9%

                                                                                                                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                          3. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4} \cdot t}{{\ell}^{2}}}} \]
                                                                                                                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites73.5%

                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}} \]

                                                                                                                                                                                                                                                                                                                                            if 5.00000000000000022e41 < k

                                                                                                                                                                                                                                                                                                                                            1. Initial program 30.5%

                                                                                                                                                                                                                                                                                                                                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                            3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites55.1%

                                                                                                                                                                                                                                                                                                                                                \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                              2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites48.4%

                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                                  3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                  4. Final simplification73.6%

                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 5 \cdot 10^{+41}:\\ \;\;\;\;\frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                                  5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                  Alternative 18: 75.0% accurate, 3.2× speedup?

                                                                                                                                                                                                                                                                                                                                                  \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{elif}\;k\_m \leq 10^{+40}:\\ \;\;\;\;\frac{\frac{\ell}{{k\_m}^{4}}}{t} \cdot \left(\ell + \ell\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                                                                  k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                  (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                   :precision binary64
                                                                                                                                                                                                                                                                                                                                                   (if (<= k_m 1.5e-79)
                                                                                                                                                                                                                                                                                                                                                     (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                                                                                                     (if (<= k_m 1e+40)
                                                                                                                                                                                                                                                                                                                                                       (* (/ (/ l (pow k_m 4.0)) t) (+ l l))
                                                                                                                                                                                                                                                                                                                                                       (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                                                                                                                                  k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                  double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                  	double tmp;
                                                                                                                                                                                                                                                                                                                                                  	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                                                                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                  	} else if (k_m <= 1e+40) {
                                                                                                                                                                                                                                                                                                                                                  		tmp = ((l / pow(k_m, 4.0)) / t) * (l + l);
                                                                                                                                                                                                                                                                                                                                                  	} else {
                                                                                                                                                                                                                                                                                                                                                  		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                  	}
                                                                                                                                                                                                                                                                                                                                                  	return tmp;
                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m =     private
                                                                                                                                                                                                                                                                                                                                                  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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                  use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                      real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                      real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                      real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                      real(8) :: tmp
                                                                                                                                                                                                                                                                                                                                                      if (k_m <= 1.5d-79) then
                                                                                                                                                                                                                                                                                                                                                          tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                      else if (k_m <= 1d+40) then
                                                                                                                                                                                                                                                                                                                                                          tmp = ((l / (k_m ** 4.0d0)) / t) * (l + l)
                                                                                                                                                                                                                                                                                                                                                      else
                                                                                                                                                                                                                                                                                                                                                          tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                      end if
                                                                                                                                                                                                                                                                                                                                                      code = tmp
                                                                                                                                                                                                                                                                                                                                                  end function
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                  public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                  	double tmp;
                                                                                                                                                                                                                                                                                                                                                  	if (k_m <= 1.5e-79) {
                                                                                                                                                                                                                                                                                                                                                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                  	} else if (k_m <= 1e+40) {
                                                                                                                                                                                                                                                                                                                                                  		tmp = ((l / Math.pow(k_m, 4.0)) / t) * (l + l);
                                                                                                                                                                                                                                                                                                                                                  	} else {
                                                                                                                                                                                                                                                                                                                                                  		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                  	}
                                                                                                                                                                                                                                                                                                                                                  	return tmp;
                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                  def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                  	tmp = 0
                                                                                                                                                                                                                                                                                                                                                  	if k_m <= 1.5e-79:
                                                                                                                                                                                                                                                                                                                                                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                  	elif k_m <= 1e+40:
                                                                                                                                                                                                                                                                                                                                                  		tmp = ((l / math.pow(k_m, 4.0)) / t) * (l + l)
                                                                                                                                                                                                                                                                                                                                                  	else:
                                                                                                                                                                                                                                                                                                                                                  		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                  	return tmp
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                  function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                  	tmp = 0.0
                                                                                                                                                                                                                                                                                                                                                  	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                                                                  		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                                                                                                  	elseif (k_m <= 1e+40)
                                                                                                                                                                                                                                                                                                                                                  		tmp = Float64(Float64(Float64(l / (k_m ^ 4.0)) / t) * Float64(l + l));
                                                                                                                                                                                                                                                                                                                                                  	else
                                                                                                                                                                                                                                                                                                                                                  		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                                                                  	end
                                                                                                                                                                                                                                                                                                                                                  	return tmp
                                                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                  function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                  	tmp = 0.0;
                                                                                                                                                                                                                                                                                                                                                  	if (k_m <= 1.5e-79)
                                                                                                                                                                                                                                                                                                                                                  		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                  	elseif (k_m <= 1e+40)
                                                                                                                                                                                                                                                                                                                                                  		tmp = ((l / (k_m ^ 4.0)) / t) * (l + l);
                                                                                                                                                                                                                                                                                                                                                  	else
                                                                                                                                                                                                                                                                                                                                                  		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                  	end
                                                                                                                                                                                                                                                                                                                                                  	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                                  end
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                  code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1.5e-79], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1e+40], N[(N[(N[(l / N[Power[k$95$m, 4.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                  k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  \\
                                                                                                                                                                                                                                                                                                                                                  \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                  \mathbf{if}\;k\_m \leq 1.5 \cdot 10^{-79}:\\
                                                                                                                                                                                                                                                                                                                                                  \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  \mathbf{elif}\;k\_m \leq 10^{+40}:\\
                                                                                                                                                                                                                                                                                                                                                  \;\;\;\;\frac{\frac{\ell}{{k\_m}^{4}}}{t} \cdot \left(\ell + \ell\right)\\
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                                  \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  \end{array}
                                                                                                                                                                                                                                                                                                                                                  \end{array}
                                                                                                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                                                                                                  Derivation
                                                                                                                                                                                                                                                                                                                                                  1. Split input into 3 regimes
                                                                                                                                                                                                                                                                                                                                                  2. if k < 1.5e-79

                                                                                                                                                                                                                                                                                                                                                    1. Initial program 36.3%

                                                                                                                                                                                                                                                                                                                                                      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                    3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites74.3%

                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                      2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                          2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites81.1%

                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                                                                                            if 1.5e-79 < k < 1.00000000000000003e40

                                                                                                                                                                                                                                                                                                                                                            1. Initial program 24.9%

                                                                                                                                                                                                                                                                                                                                                              \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                            3. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                                                                                                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites69.0%

                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites73.6%

                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{\ell}{{k}^{4}}}{t} \cdot \left(\color{blue}{\ell} + \ell\right) \]

                                                                                                                                                                                                                                                                                                                                                                if 1.00000000000000003e40 < k

                                                                                                                                                                                                                                                                                                                                                                1. Initial program 30.5%

                                                                                                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites55.1%

                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites43.3%

                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites48.4%

                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                                                      3. Recombined 3 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                                      4. Final simplification73.6%

                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.5 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{elif}\;k \leq 10^{+40}:\\ \;\;\;\;\frac{\frac{\ell}{{k}^{4}}}{t} \cdot \left(\ell + \ell\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                      Alternative 19: 74.0% accurate, 6.4× speedup?

                                                                                                                                                                                                                                                                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                                      (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                                                                                                                                                       (if (<= k_m 2e-20)
                                                                                                                                                                                                                                                                                                                                                                         (* (/ (/ (/ 2.0 k_m) t) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                                                                                                                         (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m))))
                                                                                                                                                                                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20) {
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m =     private
                                                                                                                                                                                                                                                                                                                                                                      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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                                                                                                                                                                                                                          if (k_m <= 2d-20) then
                                                                                                                                                                                                                                                                                                                                                                              tmp = (((2.0d0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                                              tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                          end if
                                                                                                                                                                                                                                                                                                                                                                          code = tmp
                                                                                                                                                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                                      public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20) {
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                                      def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                                                                                                                                                                                                      	if k_m <= 2e-20:
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                      	else:
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                                      function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20)
                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(Float64(2.0 / k_m) / t) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                                      function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20)
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (((2.0 / k_m) / t) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2e-20], N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                      \mathbf{if}\;k\_m \leq 2 \cdot 10^{-20}:\\
                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;\frac{\frac{\frac{2}{k\_m}}{t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                                                                                      2. if k < 1.99999999999999989e-20

                                                                                                                                                                                                                                                                                                                                                                        1. Initial program 36.4%

                                                                                                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites73.9%

                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites80.9%

                                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites80.9%

                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                                                                                                                if 1.99999999999999989e-20 < k

                                                                                                                                                                                                                                                                                                                                                                                1. Initial program 27.7%

                                                                                                                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites62.9%

                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites46.4%

                                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites46.4%

                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites50.4%

                                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                                                      4. Final simplification72.8%

                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{\frac{2}{k}}{t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                                      Alternative 20: 74.1% accurate, 7.0× speedup?

                                                                                                                                                                                                                                                                                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{2}{k\_m \cdot t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                                                      (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                                                                                                                                                                       (if (<= k_m 2e-20)
                                                                                                                                                                                                                                                                                                                                                                                         (* (/ (/ 2.0 (* k_m t)) k_m) (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                                                                                                                                         (* (/ 2.0 (* k_m (* k_m t))) (/ (* (/ l k_m) l) k_m))))
                                                                                                                                                                                                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20) {
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = ((2.0 / (k_m * t)) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m =     private
                                                                                                                                                                                                                                                                                                                                                                                      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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                                                                                                                                                                                                                                          if (k_m <= 2d-20) then
                                                                                                                                                                                                                                                                                                                                                                                              tmp = ((2.0d0 / (k_m * t)) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                                                              tmp = (2.0d0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                                          end if
                                                                                                                                                                                                                                                                                                                                                                                          code = tmp
                                                                                                                                                                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                                                      public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20) {
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = ((2.0 / (k_m * t)) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                                                      def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                                                                                                                                                                                                                      	if k_m <= 2e-20:
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = ((2.0 / (k_m * t)) / k_m) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                      	else:
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                                                      function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20)
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(Float64(2.0 / Float64(k_m * t)) / k_m) * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                                                      function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                                                                                                                                                                                                                                      	if (k_m <= 2e-20)
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = ((2.0 / (k_m * t)) / k_m) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                                      		tmp = (2.0 / (k_m * (k_m * t))) * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                      code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2e-20], N[(N[(N[(2.0 / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                      \mathbf{if}\;k\_m \leq 2 \cdot 10^{-20}:\\
                                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;\frac{\frac{2}{k\_m \cdot t}}{k\_m} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;\frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                                                                                                      2. if k < 1.99999999999999989e-20

                                                                                                                                                                                                                                                                                                                                                                                        1. Initial program 36.4%

                                                                                                                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites73.9%

                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites77.2%

                                                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites80.9%

                                                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites80.9%

                                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{\frac{2}{k \cdot t}}{k} \cdot \left(\color{blue}{\frac{\ell}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                                                                                                                                if 1.99999999999999989e-20 < k

                                                                                                                                                                                                                                                                                                                                                                                                1. Initial program 27.7%

                                                                                                                                                                                                                                                                                                                                                                                                  \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                                3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites62.9%

                                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                  2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites46.4%

                                                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites46.4%

                                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                      2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites50.4%

                                                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                                                                                      3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                                                                      4. Final simplification72.8%

                                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 2 \cdot 10^{-20}:\\ \;\;\;\;\frac{\frac{2}{k \cdot t}}{k} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                                                      Alternative 21: 73.9% accurate, 7.7× speedup?

                                                                                                                                                                                                                                                                                                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)}\\ \mathbf{if}\;\ell \leq 2 \cdot 10^{-122}:\\ \;\;\;\;t\_1 \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\ \end{array} \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                                                                      (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                                                                                                                                                                                                                                       (let* ((t_1 (/ 2.0 (* k_m (* k_m t)))))
                                                                                                                                                                                                                                                                                                                                                                                                         (if (<= l 2e-122)
                                                                                                                                                                                                                                                                                                                                                                                                           (* t_1 (* (/ l k_m) (/ l k_m)))
                                                                                                                                                                                                                                                                                                                                                                                                           (* t_1 (/ (* (/ l k_m) l) k_m)))))
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                      	double t_1 = 2.0 / (k_m * (k_m * t));
                                                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                                                      	if (l <= 2e-122) {
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m =     private
                                                                                                                                                                                                                                                                                                                                                                                                      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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                                                                          real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                                                                          real(8) :: t_1
                                                                                                                                                                                                                                                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                                                                                                                                                                                                                                                          t_1 = 2.0d0 / (k_m * (k_m * t))
                                                                                                                                                                                                                                                                                                                                                                                                          if (l <= 2d-122) then
                                                                                                                                                                                                                                                                                                                                                                                                              tmp = t_1 * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                                          else
                                                                                                                                                                                                                                                                                                                                                                                                              tmp = t_1 * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                                                          end if
                                                                                                                                                                                                                                                                                                                                                                                                          code = tmp
                                                                                                                                                                                                                                                                                                                                                                                                      end function
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                      public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                      	double t_1 = 2.0 / (k_m * (k_m * t));
                                                                                                                                                                                                                                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                                                                                                                                                                                                                                      	if (l <= 2e-122) {
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                      	} else {
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                                      	}
                                                                                                                                                                                                                                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                                                                      def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                                                                      	t_1 = 2.0 / (k_m * (k_m * t))
                                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                                                                                                                                                                                                                                      	if l <= 2e-122:
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                                      	else:
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * (((l / k_m) * l) / k_m)
                                                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                                                                      function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                      	t_1 = Float64(2.0 / Float64(k_m * Float64(k_m * t)))
                                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                                                                                                                                                                                                                                      	if (l <= 2e-122)
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(t_1 * Float64(Float64(l / k_m) * Float64(l / k_m)));
                                                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = Float64(t_1 * Float64(Float64(Float64(l / k_m) * l) / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                                                      	return tmp
                                                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                      function tmp_2 = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                      	t_1 = 2.0 / (k_m * (k_m * t));
                                                                                                                                                                                                                                                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                                                                                                                                                                                                                                                      	if (l <= 2e-122)
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                      	else
                                                                                                                                                                                                                                                                                                                                                                                                      		tmp = t_1 * (((l / k_m) * l) / k_m);
                                                                                                                                                                                                                                                                                                                                                                                                      	end
                                                                                                                                                                                                                                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                                                                                                                                                                                                                                      end
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                                      code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, 2e-122], N[(t$95$1 * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[(l / k$95$m), $MachinePrecision] * l), $MachinePrecision] / k$95$m), $MachinePrecision]), $MachinePrecision]]]
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                                      k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      \\
                                                                                                                                                                                                                                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                                      t_1 := \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)}\\
                                                                                                                                                                                                                                                                                                                                                                                                      \mathbf{if}\;\ell \leq 2 \cdot 10^{-122}:\\
                                                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;t\_1 \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                                                                                                                                                                                                                                      \;\;\;\;t\_1 \cdot \frac{\frac{\ell}{k\_m} \cdot \ell}{k\_m}\\
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                                                      \end{array}
                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                      Derivation
                                                                                                                                                                                                                                                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                                                                                                                                                                                                                                                      2. if l < 2.00000000000000012e-122

                                                                                                                                                                                                                                                                                                                                                                                                        1. Initial program 33.4%

                                                                                                                                                                                                                                                                                                                                                                                                          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                                        3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites69.5%

                                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                          2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites69.9%

                                                                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                            2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites73.5%

                                                                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]

                                                                                                                                                                                                                                                                                                                                                                                                              if 2.00000000000000012e-122 < l

                                                                                                                                                                                                                                                                                                                                                                                                              1. Initial program 35.5%

                                                                                                                                                                                                                                                                                                                                                                                                                \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                                              2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                                              3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                                              4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites73.8%

                                                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites67.2%

                                                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                  2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                    1. Applied rewrites68.1%

                                                                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                    2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites70.3%

                                                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k} \]
                                                                                                                                                                                                                                                                                                                                                                                                                    3. Recombined 2 regimes into one program.
                                                                                                                                                                                                                                                                                                                                                                                                                    4. Final simplification72.4%

                                                                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 2 \cdot 10^{-122}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\frac{\ell}{k} \cdot \ell}{k}\\ \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                                                    5. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                                                                    Alternative 22: 73.8% accurate, 8.6× speedup?

                                                                                                                                                                                                                                                                                                                                                                                                                    \[\begin{array}{l} k_m = \left|k\right| \\ \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                                                                                    (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                     :precision binary64
                                                                                                                                                                                                                                                                                                                                                                                                                     (* (/ 2.0 (* k_m (* k_m t))) (* (/ l k_m) (/ l k_m))))
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                    double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                                    	return (2.0 / (k_m * (k_m * t))) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m =     private
                                                                                                                                                                                                                                                                                                                                                                                                                    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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                    use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                                                                                        real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                                                                                        real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                                                                                        real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                                                                                        code = (2.0d0 / (k_m * (k_m * t))) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                                                    end function
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                    public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                                    	return (2.0 / (k_m * (k_m * t))) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                                                                                    def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                                                                                    	return (2.0 / (k_m * (k_m * t))) * ((l / k_m) * (l / k_m))
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                                                                                    function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                    	return Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(Float64(l / k_m) * Float64(l / k_m)))
                                                                                                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                    function tmp = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                    	tmp = (2.0 / (k_m * (k_m * t))) * ((l / k_m) * (l / k_m));
                                                                                                                                                                                                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                                                    code[t_, l_, k$95$m_] := N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                                                    k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    \\
                                                                                                                                                                                                                                                                                                                                                                                                                    \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right)
                                                                                                                                                                                                                                                                                                                                                                                                                    \end{array}
                                                                                                                                                                                                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                                                                                                                                                                                    Derivation
                                                                                                                                                                                                                                                                                                                                                                                                                    1. Initial program 34.1%

                                                                                                                                                                                                                                                                                                                                                                                                                      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                                                    3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                                                      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                      1. Applied rewrites70.9%

                                                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                      2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                                                        \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                        1. Applied rewrites69.0%

                                                                                                                                                                                                                                                                                                                                                                                                                          \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                        2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                          1. Applied rewrites71.7%

                                                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                          2. Final simplification71.7%

                                                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                          3. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                                                                          Alternative 23: 72.6% accurate, 9.6× speedup?

                                                                                                                                                                                                                                                                                                                                                                                                                          \[\begin{array}{l} k_m = \left|k\right| \\ \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \left(\ell \cdot \frac{\ell}{k\_m \cdot k\_m}\right) \end{array} \]
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = (fabs.f64 k)
                                                                                                                                                                                                                                                                                                                                                                                                                          (FPCore (t l k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                           :precision binary64
                                                                                                                                                                                                                                                                                                                                                                                                                           (* (/ 2.0 (* k_m (* k_m t))) (* l (/ l (* k_m k_m)))))
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = fabs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                          double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                                          	return (2.0 / (k_m * (k_m * t))) * (l * (l / (k_m * k_m)));
                                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m =     private
                                                                                                                                                                                                                                                                                                                                                                                                                          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(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                          use fmin_fmax_functions
                                                                                                                                                                                                                                                                                                                                                                                                                              real(8), intent (in) :: t
                                                                                                                                                                                                                                                                                                                                                                                                                              real(8), intent (in) :: l
                                                                                                                                                                                                                                                                                                                                                                                                                              real(8), intent (in) :: k_m
                                                                                                                                                                                                                                                                                                                                                                                                                              code = (2.0d0 / (k_m * (k_m * t))) * (l * (l / (k_m * k_m)))
                                                                                                                                                                                                                                                                                                                                                                                                                          end function
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = Math.abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                          public static double code(double t, double l, double k_m) {
                                                                                                                                                                                                                                                                                                                                                                                                                          	return (2.0 / (k_m * (k_m * t))) * (l * (l / (k_m * k_m)));
                                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = math.fabs(k)
                                                                                                                                                                                                                                                                                                                                                                                                                          def code(t, l, k_m):
                                                                                                                                                                                                                                                                                                                                                                                                                          	return (2.0 / (k_m * (k_m * t))) * (l * (l / (k_m * k_m)))
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = abs(k)
                                                                                                                                                                                                                                                                                                                                                                                                                          function code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                          	return Float64(Float64(2.0 / Float64(k_m * Float64(k_m * t))) * Float64(l * Float64(l / Float64(k_m * k_m))))
                                                                                                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = abs(k);
                                                                                                                                                                                                                                                                                                                                                                                                                          function tmp = code(t, l, k_m)
                                                                                                                                                                                                                                                                                                                                                                                                                          	tmp = (2.0 / (k_m * (k_m * t))) * (l * (l / (k_m * k_m)));
                                                                                                                                                                                                                                                                                                                                                                                                                          end
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                                                          code[t_, l_, k$95$m_] := N[(N[(2.0 / N[(k$95$m * N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          \begin{array}{l}
                                                                                                                                                                                                                                                                                                                                                                                                                          k_m = \left|k\right|
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          \\
                                                                                                                                                                                                                                                                                                                                                                                                                          \frac{2}{k\_m \cdot \left(k\_m \cdot t\right)} \cdot \left(\ell \cdot \frac{\ell}{k\_m \cdot k\_m}\right)
                                                                                                                                                                                                                                                                                                                                                                                                                          \end{array}
                                                                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                                                          Derivation
                                                                                                                                                                                                                                                                                                                                                                                                                          1. Initial program 34.1%

                                                                                                                                                                                                                                                                                                                                                                                                                            \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
                                                                                                                                                                                                                                                                                                                                                                                                                          2. Add Preprocessing
                                                                                                                                                                                                                                                                                                                                                                                                                          3. Taylor expanded in t around 0

                                                                                                                                                                                                                                                                                                                                                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                          4. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                            1. Applied rewrites70.9%

                                                                                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                            2. Taylor expanded in k around 0

                                                                                                                                                                                                                                                                                                                                                                                                                              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
                                                                                                                                                                                                                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                              1. Applied rewrites69.0%

                                                                                                                                                                                                                                                                                                                                                                                                                                \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \color{blue}{\frac{\ell}{k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                              2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                                1. Applied rewrites71.7%

                                                                                                                                                                                                                                                                                                                                                                                                                                  \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\frac{\ell}{\color{blue}{k}} \cdot \frac{\ell}{k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                                2. Step-by-step derivation
                                                                                                                                                                                                                                                                                                                                                                                                                                  1. Applied rewrites69.0%

                                                                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{k \cdot k}}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                                  2. Final simplification69.0%

                                                                                                                                                                                                                                                                                                                                                                                                                                    \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \left(\ell \cdot \frac{\ell}{k \cdot k}\right) \]
                                                                                                                                                                                                                                                                                                                                                                                                                                  3. Add Preprocessing

                                                                                                                                                                                                                                                                                                                                                                                                                                  Reproduce

                                                                                                                                                                                                                                                                                                                                                                                                                                  ?
                                                                                                                                                                                                                                                                                                                                                                                                                                  herbie shell --seed 2025019 
                                                                                                                                                                                                                                                                                                                                                                                                                                  (FPCore (t l k)
                                                                                                                                                                                                                                                                                                                                                                                                                                    :name "Toniolo and Linder, Equation (10-)"
                                                                                                                                                                                                                                                                                                                                                                                                                                    :precision binary64
                                                                                                                                                                                                                                                                                                                                                                                                                                    (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))