Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.8% → 98.7%
Time: 14.0s
Alternatives: 17
Speedup: 11.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 17 alternatives:

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

Initial Program: 35.8% 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: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \cos k\_m \cdot 2\\ t_2 := {\sin k\_m}^{2}\\ \mathbf{if}\;k\_m \leq 1.22 \cdot 10^{-152}:\\ \;\;\;\;\frac{\frac{\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t} \cdot t\_1}{\sin k\_m}}{\sin k\_m}\\ \mathbf{elif}\;k\_m \leq 1.5 \cdot 10^{-63}:\\ \;\;\;\;\frac{2 \cdot \ell}{t\_2} \cdot \frac{\frac{\ell}{k\_m}}{k\_m \cdot t}\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{t\_2 \cdot k\_m}\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (* (cos k_m) 2.0)) (t_2 (pow (sin k_m) 2.0)))
   (if (<= k_m 1.22e-152)
     (/ (/ (* (/ (pow (/ l k_m) 2.0) t) t_1) (sin k_m)) (sin k_m))
     (if (<= k_m 1.5e-63)
       (* (/ (* 2.0 l) t_2) (/ (/ l k_m) (* k_m t)))
       (* t_1 (* (/ (/ l k_m) t) (/ l (* t_2 k_m))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = cos(k_m) * 2.0;
	double t_2 = pow(sin(k_m), 2.0);
	double tmp;
	if (k_m <= 1.22e-152) {
		tmp = (((pow((l / k_m), 2.0) / t) * t_1) / sin(k_m)) / sin(k_m);
	} else if (k_m <= 1.5e-63) {
		tmp = ((2.0 * l) / t_2) * ((l / k_m) / (k_m * t));
	} else {
		tmp = t_1 * (((l / k_m) / t) * (l / (t_2 * 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) :: t_2
    real(8) :: tmp
    t_1 = cos(k_m) * 2.0d0
    t_2 = sin(k_m) ** 2.0d0
    if (k_m <= 1.22d-152) then
        tmp = (((((l / k_m) ** 2.0d0) / t) * t_1) / sin(k_m)) / sin(k_m)
    else if (k_m <= 1.5d-63) then
        tmp = ((2.0d0 * l) / t_2) * ((l / k_m) / (k_m * t))
    else
        tmp = t_1 * (((l / k_m) / t) * (l / (t_2 * 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 = Math.cos(k_m) * 2.0;
	double t_2 = Math.pow(Math.sin(k_m), 2.0);
	double tmp;
	if (k_m <= 1.22e-152) {
		tmp = (((Math.pow((l / k_m), 2.0) / t) * t_1) / Math.sin(k_m)) / Math.sin(k_m);
	} else if (k_m <= 1.5e-63) {
		tmp = ((2.0 * l) / t_2) * ((l / k_m) / (k_m * t));
	} else {
		tmp = t_1 * (((l / k_m) / t) * (l / (t_2 * k_m)));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = math.cos(k_m) * 2.0
	t_2 = math.pow(math.sin(k_m), 2.0)
	tmp = 0
	if k_m <= 1.22e-152:
		tmp = (((math.pow((l / k_m), 2.0) / t) * t_1) / math.sin(k_m)) / math.sin(k_m)
	elif k_m <= 1.5e-63:
		tmp = ((2.0 * l) / t_2) * ((l / k_m) / (k_m * t))
	else:
		tmp = t_1 * (((l / k_m) / t) * (l / (t_2 * k_m)))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(cos(k_m) * 2.0)
	t_2 = sin(k_m) ^ 2.0
	tmp = 0.0
	if (k_m <= 1.22e-152)
		tmp = Float64(Float64(Float64(Float64((Float64(l / k_m) ^ 2.0) / t) * t_1) / sin(k_m)) / sin(k_m));
	elseif (k_m <= 1.5e-63)
		tmp = Float64(Float64(Float64(2.0 * l) / t_2) * Float64(Float64(l / k_m) / Float64(k_m * t)));
	else
		tmp = Float64(t_1 * Float64(Float64(Float64(l / k_m) / t) * Float64(l / Float64(t_2 * k_m))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = cos(k_m) * 2.0;
	t_2 = sin(k_m) ^ 2.0;
	tmp = 0.0;
	if (k_m <= 1.22e-152)
		tmp = (((((l / k_m) ^ 2.0) / t) * t_1) / sin(k_m)) / sin(k_m);
	elseif (k_m <= 1.5e-63)
		tmp = ((2.0 * l) / t_2) * ((l / k_m) / (k_m * t));
	else
		tmp = t_1 * (((l / k_m) / t) * (l / (t_2 * k_m)));
	end
	tmp_2 = 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] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]}, If[LessEqual[k$95$m, 1.22e-152], N[(N[(N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / t), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] / N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 1.5e-63], N[(N[(N[(2.0 * l), $MachinePrecision] / t$95$2), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[(N[(l / k$95$m), $MachinePrecision] / t), $MachinePrecision] * N[(l / N[(t$95$2 * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \cos k\_m \cdot 2\\
t_2 := {\sin k\_m}^{2}\\
\mathbf{if}\;k\_m \leq 1.22 \cdot 10^{-152}:\\
\;\;\;\;\frac{\frac{\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{t} \cdot t\_1}{\sin k\_m}}{\sin k\_m}\\

\mathbf{elif}\;k\_m \leq 1.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{2 \cdot \ell}{t\_2} \cdot \frac{\frac{\ell}{k\_m}}{k\_m \cdot t}\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{t\_2 \cdot k\_m}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 1.22000000000000009e-152

    1. Initial program 38.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. count-2-revN/A

        \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      2. div-add-revN/A

        \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      3. count-2-revN/A

        \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      4. *-commutativeN/A

        \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      5. associate-*r*N/A

        \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
      6. *-commutativeN/A

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

        \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
      8. associate-*r*N/A

        \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
      9. times-fracN/A

        \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
      10. lower-*.f64N/A

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

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

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

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

        if 1.22000000000000009e-152 < k < 1.4999999999999999e-63

        1. Initial program 43.8%

          \[\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. count-2-revN/A

            \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
          2. div-add-revN/A

            \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
          3. count-2-revN/A

            \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
          4. *-commutativeN/A

            \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
          5. associate-*r*N/A

            \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
          6. *-commutativeN/A

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

            \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
          8. associate-*r*N/A

            \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
          9. times-fracN/A

            \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
          10. lower-*.f64N/A

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

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

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

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

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

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

              if 1.4999999999999999e-63 < k

              1. Initial program 28.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. count-2-revN/A

                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                2. div-add-revN/A

                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                3. count-2-revN/A

                  \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                4. *-commutativeN/A

                  \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                5. associate-*r*N/A

                  \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                6. *-commutativeN/A

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

                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                8. associate-*r*N/A

                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                9. times-fracN/A

                  \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                10. lower-*.f64N/A

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

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

                  \[\leadsto \left(\cos k \cdot 2\right) \cdot \color{blue}{\left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{{\sin k}^{2} \cdot k}\right)} \]
              7. Recombined 3 regimes into one program.
              8. Add Preprocessing

              Alternative 2: 97.7% accurate, 1.3× speedup?

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

                1. Initial program 37.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 \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. *-commutativeN/A

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

                    \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                  3. associate-*r*N/A

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

                    \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                  5. associate-*l*N/A

                    \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                  6. times-fracN/A

                    \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                  7. lower-*.f64N/A

                    \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                  8. lower-/.f64N/A

                    \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  9. lower-*.f64N/A

                    \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  10. *-commutativeN/A

                    \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  11. lower-*.f64N/A

                    \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  12. lower-pow.f64N/A

                    \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  13. lower-sin.f64N/A

                    \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                  14. lower-/.f64N/A

                    \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                  15. lower-*.f64N/A

                    \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                  16. lower-cos.f6489.9

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

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

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

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

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

                    if 1.94999999999999998e-19 < k

                    1. Initial program 29.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. count-2-revN/A

                        \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                      2. div-add-revN/A

                        \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                      3. count-2-revN/A

                        \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                      4. *-commutativeN/A

                        \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                      5. associate-*r*N/A

                        \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                      6. *-commutativeN/A

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

                        \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                      8. associate-*r*N/A

                        \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                      9. times-fracN/A

                        \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                      10. lower-*.f64N/A

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

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

                        \[\leadsto \left(\cos k \cdot 2\right) \cdot \color{blue}{\left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{{\sin k}^{2} \cdot k}\right)} \]
                    7. Recombined 2 regimes into one program.
                    8. Add Preprocessing

                    Alternative 3: 97.4% accurate, 1.7× speedup?

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

                      1. Initial program 37.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 \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. *-commutativeN/A

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

                          \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                        3. associate-*r*N/A

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

                          \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                        5. associate-*l*N/A

                          \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                        6. times-fracN/A

                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                        7. lower-*.f64N/A

                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                        8. lower-/.f64N/A

                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        9. lower-*.f64N/A

                          \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        10. *-commutativeN/A

                          \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        11. lower-*.f64N/A

                          \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        12. lower-pow.f64N/A

                          \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        13. lower-sin.f64N/A

                          \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                        14. lower-/.f64N/A

                          \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                        15. lower-*.f64N/A

                          \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                        16. lower-cos.f6490.0

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

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

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

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

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

                          if 0.00160000000000000008 < k

                          1. Initial program 29.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. count-2-revN/A

                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                            2. div-add-revN/A

                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                            3. count-2-revN/A

                              \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                            4. *-commutativeN/A

                              \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                            5. associate-*r*N/A

                              \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                            6. *-commutativeN/A

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

                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                            8. associate-*r*N/A

                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                            9. times-fracN/A

                              \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                            10. lower-*.f64N/A

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

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

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

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

                            Alternative 4: 94.1% accurate, 1.7× speedup?

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

                              1. Initial program 37.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 \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. *-commutativeN/A

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

                                  \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                                3. associate-*r*N/A

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

                                  \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                                5. associate-*l*N/A

                                  \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                                6. times-fracN/A

                                  \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                7. lower-*.f64N/A

                                  \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                8. lower-/.f64N/A

                                  \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                9. lower-*.f64N/A

                                  \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                10. *-commutativeN/A

                                  \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                11. lower-*.f64N/A

                                  \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                12. lower-pow.f64N/A

                                  \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                13. lower-sin.f64N/A

                                  \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                14. lower-/.f64N/A

                                  \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                                15. lower-*.f64N/A

                                  \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                                16. lower-cos.f6490.0

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

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

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

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

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

                                  if 0.00279999999999999997 < k

                                  1. Initial program 29.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 \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. *-commutativeN/A

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

                                      \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                                    3. associate-*r*N/A

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

                                      \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                                    5. associate-*l*N/A

                                      \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                                    6. times-fracN/A

                                      \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                    7. lower-*.f64N/A

                                      \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                    8. lower-/.f64N/A

                                      \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    9. lower-*.f64N/A

                                      \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    10. *-commutativeN/A

                                      \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    11. lower-*.f64N/A

                                      \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    12. lower-pow.f64N/A

                                      \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    13. lower-sin.f64N/A

                                      \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    14. lower-/.f64N/A

                                      \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                                    15. lower-*.f64N/A

                                      \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                                    16. lower-cos.f6495.0

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

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

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

                                        \[\leadsto \frac{2}{\left(k \cdot \frac{\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t}{\ell}\right) \cdot \frac{k}{\ell \cdot \cos k}} \]
                                    3. Recombined 2 regimes into one program.
                                    4. Add Preprocessing

                                    Alternative 5: 94.4% accurate, 1.7× speedup?

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

                                      1. Initial program 37.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 \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. *-commutativeN/A

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

                                          \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                                        3. associate-*r*N/A

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

                                          \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                                        5. associate-*l*N/A

                                          \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                                        6. times-fracN/A

                                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                        7. lower-*.f64N/A

                                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                        8. lower-/.f64N/A

                                          \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        9. lower-*.f64N/A

                                          \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        10. *-commutativeN/A

                                          \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        11. lower-*.f64N/A

                                          \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        12. lower-pow.f64N/A

                                          \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        13. lower-sin.f64N/A

                                          \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                        14. lower-/.f64N/A

                                          \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                                        15. lower-*.f64N/A

                                          \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                                        16. lower-cos.f6490.0

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

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

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

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

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

                                          if 0.00160000000000000008 < k

                                          1. Initial program 29.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. count-2-revN/A

                                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                            2. div-add-revN/A

                                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                            3. count-2-revN/A

                                              \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                            4. *-commutativeN/A

                                              \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                            5. associate-*r*N/A

                                              \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                            6. *-commutativeN/A

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

                                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                            8. associate-*r*N/A

                                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                            9. times-fracN/A

                                              \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                            10. lower-*.f64N/A

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

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

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

                                                \[\leadsto \left(\cos k \cdot 2\right) \cdot \left(\frac{\ell}{\left(\left(0.5 - 0.5 \cdot \cos \left(k + k\right)\right) \cdot t\right) \cdot k} \cdot \frac{\ell}{k}\right) \]
                                            3. Recombined 2 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 6: 87.5% accurate, 1.8× speedup?

                                            \[\begin{array}{l} k_m = \left|k\right| \\ \frac{2}{\frac{\left(\tan k\_m \cdot \sin k\_m\right) \cdot \frac{\left(k\_m \cdot t\right) \cdot k\_m}{\ell}}{\ell}} \end{array} \]
                                            k_m = (fabs.f64 k)
                                            (FPCore (t l k_m)
                                             :precision binary64
                                             (/ 2.0 (/ (* (* (tan k_m) (sin k_m)) (/ (* (* k_m t) k_m) l)) l)))
                                            k_m = fabs(k);
                                            double code(double t, double l, double k_m) {
                                            	return 2.0 / (((tan(k_m) * sin(k_m)) * (((k_m * t) * k_m) / l)) / l);
                                            }
                                            
                                            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 / (((tan(k_m) * sin(k_m)) * (((k_m * t) * k_m) / l)) / l)
                                            end function
                                            
                                            k_m = Math.abs(k);
                                            public static double code(double t, double l, double k_m) {
                                            	return 2.0 / (((Math.tan(k_m) * Math.sin(k_m)) * (((k_m * t) * k_m) / l)) / l);
                                            }
                                            
                                            k_m = math.fabs(k)
                                            def code(t, l, k_m):
                                            	return 2.0 / (((math.tan(k_m) * math.sin(k_m)) * (((k_m * t) * k_m) / l)) / l)
                                            
                                            k_m = abs(k)
                                            function code(t, l, k_m)
                                            	return Float64(2.0 / Float64(Float64(Float64(tan(k_m) * sin(k_m)) * Float64(Float64(Float64(k_m * t) * k_m) / l)) / l))
                                            end
                                            
                                            k_m = abs(k);
                                            function tmp = code(t, l, k_m)
                                            	tmp = 2.0 / (((tan(k_m) * sin(k_m)) * (((k_m * t) * k_m) / l)) / l);
                                            end
                                            
                                            k_m = N[Abs[k], $MachinePrecision]
                                            code[t_, l_, k$95$m_] := N[(2.0 / N[(N[(N[(N[Tan[k$95$m], $MachinePrecision] * N[Sin[k$95$m], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(k$95$m * t), $MachinePrecision] * k$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            k_m = \left|k\right|
                                            
                                            \\
                                            \frac{2}{\frac{\left(\tan k\_m \cdot \sin k\_m\right) \cdot \frac{\left(k\_m \cdot t\right) \cdot k\_m}{\ell}}{\ell}}
                                            \end{array}
                                            
                                            Derivation
                                            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 \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. *-commutativeN/A

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

                                                \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                                              3. associate-*r*N/A

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

                                                \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                                              5. associate-*l*N/A

                                                \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                                              6. times-fracN/A

                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                              7. lower-*.f64N/A

                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                              8. lower-/.f64N/A

                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              9. lower-*.f64N/A

                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              10. *-commutativeN/A

                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              11. lower-*.f64N/A

                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              12. lower-pow.f64N/A

                                                \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              13. lower-sin.f64N/A

                                                \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                              14. lower-/.f64N/A

                                                \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                                              15. lower-*.f64N/A

                                                \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                                              16. lower-cos.f6491.3

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

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

                                                \[\leadsto \color{blue}{\frac{2}{\frac{\left(\tan k \cdot \sin k\right) \cdot \frac{\left(k \cdot t\right) \cdot k}{\ell}}{\ell}}} \]
                                              2. Add Preprocessing

                                              Alternative 7: 76.6% accurate, 1.8× speedup?

                                              \[\begin{array}{l} k_m = \left|k\right| \\ \frac{2 \cdot \ell}{{\sin k\_m}^{2}} \cdot \frac{\frac{\ell}{k\_m}}{k\_m \cdot t} \end{array} \]
                                              k_m = (fabs.f64 k)
                                              (FPCore (t l k_m)
                                               :precision binary64
                                               (* (/ (* 2.0 l) (pow (sin k_m) 2.0)) (/ (/ l k_m) (* k_m t))))
                                              k_m = fabs(k);
                                              double code(double t, double l, double k_m) {
                                              	return ((2.0 * l) / pow(sin(k_m), 2.0)) * ((l / k_m) / (k_m * t));
                                              }
                                              
                                              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 * l) / (sin(k_m) ** 2.0d0)) * ((l / k_m) / (k_m * t))
                                              end function
                                              
                                              k_m = Math.abs(k);
                                              public static double code(double t, double l, double k_m) {
                                              	return ((2.0 * l) / Math.pow(Math.sin(k_m), 2.0)) * ((l / k_m) / (k_m * t));
                                              }
                                              
                                              k_m = math.fabs(k)
                                              def code(t, l, k_m):
                                              	return ((2.0 * l) / math.pow(math.sin(k_m), 2.0)) * ((l / k_m) / (k_m * t))
                                              
                                              k_m = abs(k)
                                              function code(t, l, k_m)
                                              	return Float64(Float64(Float64(2.0 * l) / (sin(k_m) ^ 2.0)) * Float64(Float64(l / k_m) / Float64(k_m * t)))
                                              end
                                              
                                              k_m = abs(k);
                                              function tmp = code(t, l, k_m)
                                              	tmp = ((2.0 * l) / (sin(k_m) ^ 2.0)) * ((l / k_m) / (k_m * t));
                                              end
                                              
                                              k_m = N[Abs[k], $MachinePrecision]
                                              code[t_, l_, k$95$m_] := N[(N[(N[(2.0 * l), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(l / k$95$m), $MachinePrecision] / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                              
                                              \begin{array}{l}
                                              k_m = \left|k\right|
                                              
                                              \\
                                              \frac{2 \cdot \ell}{{\sin k\_m}^{2}} \cdot \frac{\frac{\ell}{k\_m}}{k\_m \cdot t}
                                              \end{array}
                                              
                                              Derivation
                                              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. count-2-revN/A

                                                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                2. div-add-revN/A

                                                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                3. count-2-revN/A

                                                  \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                4. *-commutativeN/A

                                                  \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                5. associate-*r*N/A

                                                  \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                6. *-commutativeN/A

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

                                                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                8. associate-*r*N/A

                                                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                9. times-fracN/A

                                                  \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                10. lower-*.f64N/A

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

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

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

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

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

                                                      \[\leadsto \frac{2 \cdot \ell}{{\sin k}^{2}} \cdot \color{blue}{\frac{\frac{\ell}{k}}{k \cdot t}} \]
                                                    2. Add Preprocessing

                                                    Alternative 8: 76.2% accurate, 2.6× speedup?

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

                                                      1. Initial program 36.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. count-2-revN/A

                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                        2. div-add-revN/A

                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                        3. count-2-revN/A

                                                          \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                        4. *-commutativeN/A

                                                          \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                        5. associate-*r*N/A

                                                          \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                        6. *-commutativeN/A

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

                                                          \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                        8. associate-*r*N/A

                                                          \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                        9. times-fracN/A

                                                          \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                        10. lower-*.f64N/A

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

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

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

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

                                                            \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 2\right)}{k}}{k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{t}} \cdot \frac{\ell}{k}\right) \]
                                                          2. Taylor expanded in k around inf

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

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

                                                            if 6e4 < t

                                                            1. Initial program 31.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 \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. *-commutativeN/A

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

                                                                \[\leadsto \frac{2}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}}{{\ell}^{2} \cdot \cos k}} \]
                                                              3. associate-*r*N/A

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

                                                                \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\left(\ell \cdot \ell\right)} \cdot \cos k}} \]
                                                              5. associate-*l*N/A

                                                                \[\leadsto \frac{2}{\frac{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}{\color{blue}{\ell \cdot \left(\ell \cdot \cos k\right)}}} \]
                                                              6. times-fracN/A

                                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                                              7. lower-*.f64N/A

                                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}}} \]
                                                              8. lower-/.f64N/A

                                                                \[\leadsto \frac{2}{\color{blue}{\frac{\left(t \cdot {\sin k}^{2}\right) \cdot k}{\ell}} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              9. lower-*.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left(t \cdot {\sin k}^{2}\right) \cdot k}}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              10. *-commutativeN/A

                                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              11. lower-*.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\color{blue}{\left({\sin k}^{2} \cdot t\right)} \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              12. lower-pow.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              13. lower-sin.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              14. lower-/.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \color{blue}{\frac{k}{\ell \cdot \cos k}}} \]
                                                              15. lower-*.f64N/A

                                                                \[\leadsto \frac{2}{\frac{\left({\sin k}^{2} \cdot t\right) \cdot k}{\ell} \cdot \frac{k}{\color{blue}{\ell \cdot \cos k}}} \]
                                                              16. lower-cos.f6486.7

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

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

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

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

                                                                  \[\leadsto \frac{2}{\left(k \cdot \frac{\left(\mathsf{fma}\left(-0.3333333333333333 \cdot \left(k \cdot k\right), t, t\right) \cdot k\right) \cdot k}{\ell}\right) \cdot \frac{k}{\ell \cdot \cos k}} \]
                                                              4. Recombined 2 regimes into one program.
                                                              5. Add Preprocessing

                                                              Alternative 9: 75.7% accurate, 2.6× speedup?

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

                                                                1. Initial program 37.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. count-2-revN/A

                                                                    \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                  2. div-add-revN/A

                                                                    \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                  3. count-2-revN/A

                                                                    \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                  4. *-commutativeN/A

                                                                    \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                  5. associate-*r*N/A

                                                                    \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                  6. *-commutativeN/A

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

                                                                    \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                  8. associate-*r*N/A

                                                                    \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                  9. times-fracN/A

                                                                    \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                  10. lower-*.f64N/A

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

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

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

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

                                                                      \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 2\right)}{k}}{k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{t}} \cdot \frac{\ell}{k}\right) \]
                                                                    2. Taylor expanded in k around inf

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

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

                                                                      if 2.32e179 < t

                                                                      1. Initial program 18.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. count-2-revN/A

                                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                        2. div-add-revN/A

                                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                        3. count-2-revN/A

                                                                          \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                        4. *-commutativeN/A

                                                                          \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                        5. associate-*r*N/A

                                                                          \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                        6. *-commutativeN/A

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

                                                                          \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                        8. associate-*r*N/A

                                                                          \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                        9. times-fracN/A

                                                                          \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                        10. lower-*.f64N/A

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

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

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

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

                                                                            \[\leadsto \left(\cos k \cdot 2\right) \cdot \left(\frac{\ell}{\left(\left(\left(\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 1\right) \cdot t\right) \cdot k\right) \cdot k\right) \cdot k} \cdot \frac{\ell}{k}\right) \]
                                                                        4. Recombined 2 regimes into one program.
                                                                        5. Add Preprocessing

                                                                        Alternative 10: 75.7% accurate, 5.1× speedup?

                                                                        \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 9000:\\ \;\;\;\;\frac{\left(\frac{\frac{2}{k\_m}}{k\_m} - 0.3333333333333333\right) \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m}}{k\_m} \cdot \left(\ell + \ell\right)\\ \end{array} \end{array} \]
                                                                        k_m = (fabs.f64 k)
                                                                        (FPCore (t l k_m)
                                                                         :precision binary64
                                                                         (if (<= t 9000.0)
                                                                           (*
                                                                            (/ (* (- (/ (/ 2.0 k_m) k_m) 0.3333333333333333) k_m) k_m)
                                                                            (* (/ (/ l k_m) t) (/ l k_m)))
                                                                           (* (/ (/ (/ (/ (/ l k_m) k_m) t) k_m) k_m) (+ l l))))
                                                                        k_m = fabs(k);
                                                                        double code(double t, double l, double k_m) {
                                                                        	double tmp;
                                                                        	if (t <= 9000.0) {
                                                                        		tmp = (((((2.0 / k_m) / k_m) - 0.3333333333333333) * k_m) / k_m) * (((l / k_m) / t) * (l / k_m));
                                                                        	} else {
                                                                        		tmp = (((((l / k_m) / k_m) / t) / k_m) / 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 (t <= 9000.0d0) then
                                                                                tmp = (((((2.0d0 / k_m) / k_m) - 0.3333333333333333d0) * k_m) / k_m) * (((l / k_m) / t) * (l / k_m))
                                                                            else
                                                                                tmp = (((((l / k_m) / k_m) / t) / k_m) / 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 (t <= 9000.0) {
                                                                        		tmp = (((((2.0 / k_m) / k_m) - 0.3333333333333333) * k_m) / k_m) * (((l / k_m) / t) * (l / k_m));
                                                                        	} else {
                                                                        		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l);
                                                                        	}
                                                                        	return tmp;
                                                                        }
                                                                        
                                                                        k_m = math.fabs(k)
                                                                        def code(t, l, k_m):
                                                                        	tmp = 0
                                                                        	if t <= 9000.0:
                                                                        		tmp = (((((2.0 / k_m) / k_m) - 0.3333333333333333) * k_m) / k_m) * (((l / k_m) / t) * (l / k_m))
                                                                        	else:
                                                                        		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l)
                                                                        	return tmp
                                                                        
                                                                        k_m = abs(k)
                                                                        function code(t, l, k_m)
                                                                        	tmp = 0.0
                                                                        	if (t <= 9000.0)
                                                                        		tmp = Float64(Float64(Float64(Float64(Float64(Float64(2.0 / k_m) / k_m) - 0.3333333333333333) * k_m) / k_m) * Float64(Float64(Float64(l / k_m) / t) * Float64(l / k_m)));
                                                                        	else
                                                                        		tmp = Float64(Float64(Float64(Float64(Float64(Float64(l / k_m) / k_m) / t) / k_m) / k_m) * Float64(l + l));
                                                                        	end
                                                                        	return tmp
                                                                        end
                                                                        
                                                                        k_m = abs(k);
                                                                        function tmp_2 = code(t, l, k_m)
                                                                        	tmp = 0.0;
                                                                        	if (t <= 9000.0)
                                                                        		tmp = (((((2.0 / k_m) / k_m) - 0.3333333333333333) * k_m) / k_m) * (((l / k_m) / t) * (l / k_m));
                                                                        	else
                                                                        		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l);
                                                                        	end
                                                                        	tmp_2 = tmp;
                                                                        end
                                                                        
                                                                        k_m = N[Abs[k], $MachinePrecision]
                                                                        code[t_, l_, k$95$m_] := If[LessEqual[t, 9000.0], N[(N[(N[(N[(N[(N[(2.0 / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] / t), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]]
                                                                        
                                                                        \begin{array}{l}
                                                                        k_m = \left|k\right|
                                                                        
                                                                        \\
                                                                        \begin{array}{l}
                                                                        \mathbf{if}\;t \leq 9000:\\
                                                                        \;\;\;\;\frac{\left(\frac{\frac{2}{k\_m}}{k\_m} - 0.3333333333333333\right) \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\
                                                                        
                                                                        \mathbf{else}:\\
                                                                        \;\;\;\;\frac{\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m}}{k\_m} \cdot \left(\ell + \ell\right)\\
                                                                        
                                                                        
                                                                        \end{array}
                                                                        \end{array}
                                                                        
                                                                        Derivation
                                                                        1. Split input into 2 regimes
                                                                        2. if t < 9e3

                                                                          1. Initial program 36.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. count-2-revN/A

                                                                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                            2. div-add-revN/A

                                                                              \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                            3. count-2-revN/A

                                                                              \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                            4. *-commutativeN/A

                                                                              \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                            5. associate-*r*N/A

                                                                              \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                            6. *-commutativeN/A

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

                                                                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                            8. associate-*r*N/A

                                                                              \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                            9. times-fracN/A

                                                                              \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                            10. lower-*.f64N/A

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

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

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

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

                                                                                \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 2\right)}{k}}{k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{t}} \cdot \frac{\ell}{k}\right) \]
                                                                              2. Taylor expanded in k around inf

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

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

                                                                                if 9e3 < t

                                                                                1. Initial program 31.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. count-2-revN/A

                                                                                    \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                  2. unpow2N/A

                                                                                    \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                  3. associate-/l*N/A

                                                                                    \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                  4. unpow2N/A

                                                                                    \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                  5. associate-/l*N/A

                                                                                    \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                  6. distribute-rgt-outN/A

                                                                                    \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                  7. lower-*.f64N/A

                                                                                    \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                  8. lower-/.f64N/A

                                                                                    \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                  9. lower-*.f64N/A

                                                                                    \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                  10. lower-pow.f64N/A

                                                                                    \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                  11. count-2-revN/A

                                                                                    \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                  12. lower-*.f6472.5

                                                                                    \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                5. Applied rewrites72.5%

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

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

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

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

                                                                                    Alternative 11: 75.3% accurate, 6.6× speedup?

                                                                                    \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5 \cdot 10^{+23}:\\ \;\;\;\;\frac{\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m}}{k\_m} \cdot \left(\ell + \ell\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\ \end{array} \end{array} \]
                                                                                    k_m = (fabs.f64 k)
                                                                                    (FPCore (t l k_m)
                                                                                     :precision binary64
                                                                                     (if (<= k_m 5e+23)
                                                                                       (* (/ (/ (/ (/ (/ l k_m) k_m) t) k_m) k_m) (+ l l))
                                                                                       (* (/ (* -0.3333333333333333 k_m) k_m) (* (/ (/ l k_m) t) (/ l k_m)))))
                                                                                    k_m = fabs(k);
                                                                                    double code(double t, double l, double k_m) {
                                                                                    	double tmp;
                                                                                    	if (k_m <= 5e+23) {
                                                                                    		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l);
                                                                                    	} else {
                                                                                    		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (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 <= 5d+23) then
                                                                                            tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l)
                                                                                        else
                                                                                            tmp = (((-0.3333333333333333d0) * k_m) / k_m) * (((l / k_m) / t) * (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 <= 5e+23) {
                                                                                    		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l);
                                                                                    	} else {
                                                                                    		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (l / k_m));
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    k_m = math.fabs(k)
                                                                                    def code(t, l, k_m):
                                                                                    	tmp = 0
                                                                                    	if k_m <= 5e+23:
                                                                                    		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l)
                                                                                    	else:
                                                                                    		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (l / k_m))
                                                                                    	return tmp
                                                                                    
                                                                                    k_m = abs(k)
                                                                                    function code(t, l, k_m)
                                                                                    	tmp = 0.0
                                                                                    	if (k_m <= 5e+23)
                                                                                    		tmp = Float64(Float64(Float64(Float64(Float64(Float64(l / k_m) / k_m) / t) / k_m) / k_m) * Float64(l + l));
                                                                                    	else
                                                                                    		tmp = Float64(Float64(Float64(-0.3333333333333333 * k_m) / k_m) * Float64(Float64(Float64(l / k_m) / t) * Float64(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 <= 5e+23)
                                                                                    		tmp = (((((l / k_m) / k_m) / t) / k_m) / k_m) * (l + l);
                                                                                    	else
                                                                                    		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (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, 5e+23], N[(N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] / t), $MachinePrecision] / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.3333333333333333 * k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] / t), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    k_m = \left|k\right|
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    \mathbf{if}\;k\_m \leq 5 \cdot 10^{+23}:\\
                                                                                    \;\;\;\;\frac{\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m}}{k\_m} \cdot \left(\ell + \ell\right)\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;\frac{-0.3333333333333333 \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if k < 4.9999999999999999e23

                                                                                      1. Initial program 37.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 k around 0

                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. count-2-revN/A

                                                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                        2. unpow2N/A

                                                                                          \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                        3. associate-/l*N/A

                                                                                          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                        4. unpow2N/A

                                                                                          \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                        5. associate-/l*N/A

                                                                                          \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                        6. distribute-rgt-outN/A

                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                        7. lower-*.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                        8. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                        9. lower-*.f64N/A

                                                                                          \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                        10. lower-pow.f64N/A

                                                                                          \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                        11. count-2-revN/A

                                                                                          \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                        12. lower-*.f6470.9

                                                                                          \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                      5. Applied rewrites70.9%

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

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

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

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

                                                                                            if 4.9999999999999999e23 < k

                                                                                            1. Initial program 30.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. count-2-revN/A

                                                                                                \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                              2. div-add-revN/A

                                                                                                \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                              3. count-2-revN/A

                                                                                                \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                              4. *-commutativeN/A

                                                                                                \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                              5. associate-*r*N/A

                                                                                                \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                              6. *-commutativeN/A

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

                                                                                                \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                              8. associate-*r*N/A

                                                                                                \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                                              9. times-fracN/A

                                                                                                \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                                              10. lower-*.f64N/A

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

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

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

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

                                                                                                  \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 2\right)}{k}}{k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{t}} \cdot \frac{\ell}{k}\right) \]
                                                                                                2. Taylor expanded in k around inf

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

                                                                                                    \[\leadsto \frac{-0.3333333333333333 \cdot k}{k} \cdot \left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{k}\right) \]
                                                                                                4. Recombined 2 regimes into one program.
                                                                                                5. Add Preprocessing

                                                                                                Alternative 12: 74.9% accurate, 7.0× speedup?

                                                                                                \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5 \cdot 10^{+23}:\\ \;\;\;\;\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m \cdot k\_m} \cdot \left(\ell + \ell\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\ \end{array} \end{array} \]
                                                                                                k_m = (fabs.f64 k)
                                                                                                (FPCore (t l k_m)
                                                                                                 :precision binary64
                                                                                                 (if (<= k_m 5e+23)
                                                                                                   (* (/ (/ (/ (/ l k_m) k_m) t) (* k_m k_m)) (+ l l))
                                                                                                   (* (/ (* -0.3333333333333333 k_m) k_m) (* (/ (/ l k_m) t) (/ l k_m)))))
                                                                                                k_m = fabs(k);
                                                                                                double code(double t, double l, double k_m) {
                                                                                                	double tmp;
                                                                                                	if (k_m <= 5e+23) {
                                                                                                		tmp = ((((l / k_m) / k_m) / t) / (k_m * k_m)) * (l + l);
                                                                                                	} else {
                                                                                                		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (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 <= 5d+23) then
                                                                                                        tmp = ((((l / k_m) / k_m) / t) / (k_m * k_m)) * (l + l)
                                                                                                    else
                                                                                                        tmp = (((-0.3333333333333333d0) * k_m) / k_m) * (((l / k_m) / t) * (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 <= 5e+23) {
                                                                                                		tmp = ((((l / k_m) / k_m) / t) / (k_m * k_m)) * (l + l);
                                                                                                	} else {
                                                                                                		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (l / k_m));
                                                                                                	}
                                                                                                	return tmp;
                                                                                                }
                                                                                                
                                                                                                k_m = math.fabs(k)
                                                                                                def code(t, l, k_m):
                                                                                                	tmp = 0
                                                                                                	if k_m <= 5e+23:
                                                                                                		tmp = ((((l / k_m) / k_m) / t) / (k_m * k_m)) * (l + l)
                                                                                                	else:
                                                                                                		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (l / k_m))
                                                                                                	return tmp
                                                                                                
                                                                                                k_m = abs(k)
                                                                                                function code(t, l, k_m)
                                                                                                	tmp = 0.0
                                                                                                	if (k_m <= 5e+23)
                                                                                                		tmp = Float64(Float64(Float64(Float64(Float64(l / k_m) / k_m) / t) / Float64(k_m * k_m)) * Float64(l + l));
                                                                                                	else
                                                                                                		tmp = Float64(Float64(Float64(-0.3333333333333333 * k_m) / k_m) * Float64(Float64(Float64(l / k_m) / t) * Float64(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 <= 5e+23)
                                                                                                		tmp = ((((l / k_m) / k_m) / t) / (k_m * k_m)) * (l + l);
                                                                                                	else
                                                                                                		tmp = ((-0.3333333333333333 * k_m) / k_m) * (((l / k_m) / t) * (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, 5e+23], N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] / t), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.3333333333333333 * k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] * N[(N[(N[(l / k$95$m), $MachinePrecision] / t), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                k_m = \left|k\right|
                                                                                                
                                                                                                \\
                                                                                                \begin{array}{l}
                                                                                                \mathbf{if}\;k\_m \leq 5 \cdot 10^{+23}:\\
                                                                                                \;\;\;\;\frac{\frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{t}}{k\_m \cdot k\_m} \cdot \left(\ell + \ell\right)\\
                                                                                                
                                                                                                \mathbf{else}:\\
                                                                                                \;\;\;\;\frac{-0.3333333333333333 \cdot k\_m}{k\_m} \cdot \left(\frac{\frac{\ell}{k\_m}}{t} \cdot \frac{\ell}{k\_m}\right)\\
                                                                                                
                                                                                                
                                                                                                \end{array}
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Split input into 2 regimes
                                                                                                2. if k < 4.9999999999999999e23

                                                                                                  1. Initial program 37.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 k around 0

                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. count-2-revN/A

                                                                                                      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                    2. unpow2N/A

                                                                                                      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                    3. associate-/l*N/A

                                                                                                      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                    4. unpow2N/A

                                                                                                      \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                    5. associate-/l*N/A

                                                                                                      \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                    6. distribute-rgt-outN/A

                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                    7. lower-*.f64N/A

                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                    8. lower-/.f64N/A

                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                    9. lower-*.f64N/A

                                                                                                      \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                    10. lower-pow.f64N/A

                                                                                                      \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                    11. count-2-revN/A

                                                                                                      \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                    12. lower-*.f6470.9

                                                                                                      \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                  5. Applied rewrites70.9%

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

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

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

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

                                                                                                        if 4.9999999999999999e23 < k

                                                                                                        1. Initial program 30.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. count-2-revN/A

                                                                                                            \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                          2. div-add-revN/A

                                                                                                            \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                          3. count-2-revN/A

                                                                                                            \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                          4. *-commutativeN/A

                                                                                                            \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                          5. associate-*r*N/A

                                                                                                            \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                          6. *-commutativeN/A

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

                                                                                                            \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                          8. associate-*r*N/A

                                                                                                            \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                                                          9. times-fracN/A

                                                                                                            \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                                                          10. lower-*.f64N/A

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

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

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

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

                                                                                                              \[\leadsto \frac{\frac{\mathsf{fma}\left(-0.3333333333333333, k \cdot k, 2\right)}{k}}{k} \cdot \left(\color{blue}{\frac{\frac{\ell}{k}}{t}} \cdot \frac{\ell}{k}\right) \]
                                                                                                            2. Taylor expanded in k around inf

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

                                                                                                                \[\leadsto \frac{-0.3333333333333333 \cdot k}{k} \cdot \left(\frac{\frac{\ell}{k}}{t} \cdot \frac{\ell}{k}\right) \]
                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                            5. Add Preprocessing

                                                                                                            Alternative 13: 74.4% accurate, 7.0× speedup?

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

                                                                                                              1. Initial program 34.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. count-2-revN/A

                                                                                                                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} + \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                2. div-add-revN/A

                                                                                                                  \[\leadsto \color{blue}{\frac{{\ell}^{2} \cdot \cos k + {\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                                                                                                                3. count-2-revN/A

                                                                                                                  \[\leadsto \frac{\color{blue}{2 \cdot \left({\ell}^{2} \cdot \cos k\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                                4. *-commutativeN/A

                                                                                                                  \[\leadsto \frac{2 \cdot \color{blue}{\left(\cos k \cdot {\ell}^{2}\right)}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                                5. associate-*r*N/A

                                                                                                                  \[\leadsto \frac{\color{blue}{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \]
                                                                                                                6. *-commutativeN/A

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

                                                                                                                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\left(t \cdot {\sin k}^{2}\right) \cdot \color{blue}{\left(k \cdot k\right)}} \]
                                                                                                                8. associate-*r*N/A

                                                                                                                  \[\leadsto \frac{\left(2 \cdot \cos k\right) \cdot {\ell}^{2}}{\color{blue}{\left(\left(t \cdot {\sin k}^{2}\right) \cdot k\right) \cdot k}} \]
                                                                                                                9. times-fracN/A

                                                                                                                  \[\leadsto \color{blue}{\frac{2 \cdot \cos k}{\left(t \cdot {\sin k}^{2}\right) \cdot k} \cdot \frac{{\ell}^{2}}{k}} \]
                                                                                                                10. lower-*.f64N/A

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

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

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

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

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

                                                                                                                  if 2.00000000000000006e-53 < t

                                                                                                                  1. Initial program 37.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 k around 0

                                                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                  4. Step-by-step derivation
                                                                                                                    1. count-2-revN/A

                                                                                                                      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                    2. unpow2N/A

                                                                                                                      \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                    3. associate-/l*N/A

                                                                                                                      \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                    4. unpow2N/A

                                                                                                                      \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                                    5. associate-/l*N/A

                                                                                                                      \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                                    6. distribute-rgt-outN/A

                                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                    7. lower-*.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                    8. lower-/.f64N/A

                                                                                                                      \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                    9. lower-*.f64N/A

                                                                                                                      \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                    10. lower-pow.f64N/A

                                                                                                                      \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                                    11. count-2-revN/A

                                                                                                                      \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                    12. lower-*.f6470.6

                                                                                                                      \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                  5. Applied rewrites70.6%

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

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

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

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

                                                                                                                      Alternative 14: 72.8% accurate, 8.9× speedup?

                                                                                                                      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot \left(\ell + \ell\right) \end{array} \]
                                                                                                                      k_m = (fabs.f64 k)
                                                                                                                      (FPCore (t l k_m)
                                                                                                                       :precision binary64
                                                                                                                       (* (/ (/ (/ l k_m) k_m) (* (* k_m k_m) t)) (+ l l)))
                                                                                                                      k_m = fabs(k);
                                                                                                                      double code(double t, double l, double k_m) {
                                                                                                                      	return (((l / k_m) / k_m) / ((k_m * k_m) * t)) * (l + l);
                                                                                                                      }
                                                                                                                      
                                                                                                                      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 = (((l / k_m) / k_m) / ((k_m * k_m) * t)) * (l + l)
                                                                                                                      end function
                                                                                                                      
                                                                                                                      k_m = Math.abs(k);
                                                                                                                      public static double code(double t, double l, double k_m) {
                                                                                                                      	return (((l / k_m) / k_m) / ((k_m * k_m) * t)) * (l + l);
                                                                                                                      }
                                                                                                                      
                                                                                                                      k_m = math.fabs(k)
                                                                                                                      def code(t, l, k_m):
                                                                                                                      	return (((l / k_m) / k_m) / ((k_m * k_m) * t)) * (l + l)
                                                                                                                      
                                                                                                                      k_m = abs(k)
                                                                                                                      function code(t, l, k_m)
                                                                                                                      	return Float64(Float64(Float64(Float64(l / k_m) / k_m) / Float64(Float64(k_m * k_m) * t)) * Float64(l + l))
                                                                                                                      end
                                                                                                                      
                                                                                                                      k_m = abs(k);
                                                                                                                      function tmp = code(t, l, k_m)
                                                                                                                      	tmp = (((l / k_m) / k_m) / ((k_m * k_m) * t)) * (l + l);
                                                                                                                      end
                                                                                                                      
                                                                                                                      k_m = N[Abs[k], $MachinePrecision]
                                                                                                                      code[t_, l_, k$95$m_] := N[(N[(N[(N[(l / k$95$m), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
                                                                                                                      
                                                                                                                      \begin{array}{l}
                                                                                                                      k_m = \left|k\right|
                                                                                                                      
                                                                                                                      \\
                                                                                                                      \frac{\frac{\frac{\ell}{k\_m}}{k\_m}}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot \left(\ell + \ell\right)
                                                                                                                      \end{array}
                                                                                                                      
                                                                                                                      Derivation
                                                                                                                      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 k around 0

                                                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                      4. Step-by-step derivation
                                                                                                                        1. count-2-revN/A

                                                                                                                          \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                        2. unpow2N/A

                                                                                                                          \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                        3. associate-/l*N/A

                                                                                                                          \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                        4. unpow2N/A

                                                                                                                          \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                                        5. associate-/l*N/A

                                                                                                                          \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                                        6. distribute-rgt-outN/A

                                                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                        7. lower-*.f64N/A

                                                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                        8. lower-/.f64N/A

                                                                                                                          \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                        9. lower-*.f64N/A

                                                                                                                          \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                        10. lower-pow.f64N/A

                                                                                                                          \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                                        11. count-2-revN/A

                                                                                                                          \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                        12. lower-*.f6468.7

                                                                                                                          \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                      5. Applied rewrites68.7%

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

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

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

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

                                                                                                                            Alternative 15: 73.3% accurate, 9.6× speedup?

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

                                                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                            4. Step-by-step derivation
                                                                                                                              1. count-2-revN/A

                                                                                                                                \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                              2. unpow2N/A

                                                                                                                                \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                              3. associate-/l*N/A

                                                                                                                                \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                              4. unpow2N/A

                                                                                                                                \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                                              5. associate-/l*N/A

                                                                                                                                \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                                              6. distribute-rgt-outN/A

                                                                                                                                \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                              7. lower-*.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                              8. lower-/.f64N/A

                                                                                                                                \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                              9. lower-*.f64N/A

                                                                                                                                \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                              10. lower-pow.f64N/A

                                                                                                                                \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                                              11. count-2-revN/A

                                                                                                                                \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                              12. lower-*.f6468.7

                                                                                                                                \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                            5. Applied rewrites68.7%

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

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

                                                                                                                              Alternative 16: 70.8% accurate, 11.6× speedup?

                                                                                                                              \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{\left(\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot k\_m\right) \cdot k\_m} \cdot \left(\ell + \ell\right) \end{array} \]
                                                                                                                              k_m = (fabs.f64 k)
                                                                                                                              (FPCore (t l k_m)
                                                                                                                               :precision binary64
                                                                                                                               (* (/ l (* (* (* (* k_m k_m) t) k_m) k_m)) (+ l l)))
                                                                                                                              k_m = fabs(k);
                                                                                                                              double code(double t, double l, double k_m) {
                                                                                                                              	return (l / ((((k_m * k_m) * t) * k_m) * k_m)) * (l + l);
                                                                                                                              }
                                                                                                                              
                                                                                                                              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 = (l / ((((k_m * k_m) * t) * k_m) * k_m)) * (l + l)
                                                                                                                              end function
                                                                                                                              
                                                                                                                              k_m = Math.abs(k);
                                                                                                                              public static double code(double t, double l, double k_m) {
                                                                                                                              	return (l / ((((k_m * k_m) * t) * k_m) * k_m)) * (l + l);
                                                                                                                              }
                                                                                                                              
                                                                                                                              k_m = math.fabs(k)
                                                                                                                              def code(t, l, k_m):
                                                                                                                              	return (l / ((((k_m * k_m) * t) * k_m) * k_m)) * (l + l)
                                                                                                                              
                                                                                                                              k_m = abs(k)
                                                                                                                              function code(t, l, k_m)
                                                                                                                              	return Float64(Float64(l / Float64(Float64(Float64(Float64(k_m * k_m) * t) * k_m) * k_m)) * Float64(l + l))
                                                                                                                              end
                                                                                                                              
                                                                                                                              k_m = abs(k);
                                                                                                                              function tmp = code(t, l, k_m)
                                                                                                                              	tmp = (l / ((((k_m * k_m) * t) * k_m) * k_m)) * (l + l);
                                                                                                                              end
                                                                                                                              
                                                                                                                              k_m = N[Abs[k], $MachinePrecision]
                                                                                                                              code[t_, l_, k$95$m_] := N[(N[(l / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision] * k$95$m), $MachinePrecision] * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
                                                                                                                              
                                                                                                                              \begin{array}{l}
                                                                                                                              k_m = \left|k\right|
                                                                                                                              
                                                                                                                              \\
                                                                                                                              \frac{\ell}{\left(\left(\left(k\_m \cdot k\_m\right) \cdot t\right) \cdot k\_m\right) \cdot k\_m} \cdot \left(\ell + \ell\right)
                                                                                                                              \end{array}
                                                                                                                              
                                                                                                                              Derivation
                                                                                                                              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 k around 0

                                                                                                                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                              4. Step-by-step derivation
                                                                                                                                1. count-2-revN/A

                                                                                                                                  \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                                2. unpow2N/A

                                                                                                                                  \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                                3. associate-/l*N/A

                                                                                                                                  \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                                4. unpow2N/A

                                                                                                                                  \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                                                5. associate-/l*N/A

                                                                                                                                  \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                                                6. distribute-rgt-outN/A

                                                                                                                                  \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                                7. lower-*.f64N/A

                                                                                                                                  \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                                8. lower-/.f64N/A

                                                                                                                                  \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                                9. lower-*.f64N/A

                                                                                                                                  \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                                10. lower-pow.f64N/A

                                                                                                                                  \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                                                11. count-2-revN/A

                                                                                                                                  \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                                12. lower-*.f6468.7

                                                                                                                                  \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                              5. Applied rewrites68.7%

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

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

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

                                                                                                                                      \[\leadsto \frac{\ell}{\left(\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(-k\right)\right) \cdot \left(-k\right)} \cdot \left(\ell + \ell\right) \]
                                                                                                                                    2. Final simplification70.9%

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

                                                                                                                                    Alternative 17: 70.8% accurate, 11.6× speedup?

                                                                                                                                    \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell}{\left(t \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(k\_m \cdot k\_m\right)} \cdot \left(\ell + \ell\right) \end{array} \]
                                                                                                                                    k_m = (fabs.f64 k)
                                                                                                                                    (FPCore (t l k_m)
                                                                                                                                     :precision binary64
                                                                                                                                     (* (/ l (* (* t (* k_m k_m)) (* k_m k_m))) (+ l l)))
                                                                                                                                    k_m = fabs(k);
                                                                                                                                    double code(double t, double l, double k_m) {
                                                                                                                                    	return (l / ((t * (k_m * k_m)) * (k_m * k_m))) * (l + l);
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    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 = (l / ((t * (k_m * k_m)) * (k_m * k_m))) * (l + l)
                                                                                                                                    end function
                                                                                                                                    
                                                                                                                                    k_m = Math.abs(k);
                                                                                                                                    public static double code(double t, double l, double k_m) {
                                                                                                                                    	return (l / ((t * (k_m * k_m)) * (k_m * k_m))) * (l + l);
                                                                                                                                    }
                                                                                                                                    
                                                                                                                                    k_m = math.fabs(k)
                                                                                                                                    def code(t, l, k_m):
                                                                                                                                    	return (l / ((t * (k_m * k_m)) * (k_m * k_m))) * (l + l)
                                                                                                                                    
                                                                                                                                    k_m = abs(k)
                                                                                                                                    function code(t, l, k_m)
                                                                                                                                    	return Float64(Float64(l / Float64(Float64(t * Float64(k_m * k_m)) * Float64(k_m * k_m))) * Float64(l + l))
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    k_m = abs(k);
                                                                                                                                    function tmp = code(t, l, k_m)
                                                                                                                                    	tmp = (l / ((t * (k_m * k_m)) * (k_m * k_m))) * (l + l);
                                                                                                                                    end
                                                                                                                                    
                                                                                                                                    k_m = N[Abs[k], $MachinePrecision]
                                                                                                                                    code[t_, l_, k$95$m_] := N[(N[(l / N[(N[(t * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l + l), $MachinePrecision]), $MachinePrecision]
                                                                                                                                    
                                                                                                                                    \begin{array}{l}
                                                                                                                                    k_m = \left|k\right|
                                                                                                                                    
                                                                                                                                    \\
                                                                                                                                    \frac{\ell}{\left(t \cdot \left(k\_m \cdot k\_m\right)\right) \cdot \left(k\_m \cdot k\_m\right)} \cdot \left(\ell + \ell\right)
                                                                                                                                    \end{array}
                                                                                                                                    
                                                                                                                                    Derivation
                                                                                                                                    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 k around 0

                                                                                                                                      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                                    4. Step-by-step derivation
                                                                                                                                      1. count-2-revN/A

                                                                                                                                        \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                                                                                                                                      2. unpow2N/A

                                                                                                                                        \[\leadsto \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                                      3. associate-/l*N/A

                                                                                                                                        \[\leadsto \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} + \frac{{\ell}^{2}}{{k}^{4} \cdot t} \]
                                                                                                                                      4. unpow2N/A

                                                                                                                                        \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
                                                                                                                                      5. associate-/l*N/A

                                                                                                                                        \[\leadsto \ell \cdot \frac{\ell}{{k}^{4} \cdot t} + \color{blue}{\ell \cdot \frac{\ell}{{k}^{4} \cdot t}} \]
                                                                                                                                      6. distribute-rgt-outN/A

                                                                                                                                        \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                                      7. lower-*.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t} \cdot \left(\ell + \ell\right)} \]
                                                                                                                                      8. lower-/.f64N/A

                                                                                                                                        \[\leadsto \color{blue}{\frac{\ell}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                                      9. lower-*.f64N/A

                                                                                                                                        \[\leadsto \frac{\ell}{\color{blue}{{k}^{4} \cdot t}} \cdot \left(\ell + \ell\right) \]
                                                                                                                                      10. lower-pow.f64N/A

                                                                                                                                        \[\leadsto \frac{\ell}{\color{blue}{{k}^{4}} \cdot t} \cdot \left(\ell + \ell\right) \]
                                                                                                                                      11. count-2-revN/A

                                                                                                                                        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                                      12. lower-*.f6468.7

                                                                                                                                        \[\leadsto \frac{\ell}{{k}^{4} \cdot t} \cdot \color{blue}{\left(2 \cdot \ell\right)} \]
                                                                                                                                    5. Applied rewrites68.7%

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

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

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

                                                                                                                                        Reproduce

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