Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.7% → 93.6%
Time: 8.8s
Alternatives: 22
Speedup: 9.6×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 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.7% 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: 93.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;l\_m \leq 9.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{2 \cdot \frac{t\_2 \cdot l\_m}{t\_1}}{\left(k \cdot t\right) \cdot k}\\

\mathbf{else}:\\
\;\;\;\;\left(\cos k \cdot {\left(\frac{l\_m}{k}\right)}^{2}\right) \cdot \frac{4}{\left(t\_1 \cdot t\right) \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < 1.00000000000000003e-139

    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 inf

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{1} - 1\right)} \]
      2. 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}}} \]
      3. Step-by-step derivation
        1. unpow2N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k \cdot \ell} \cdot \color{blue}{\frac{{\sin k}^{2}}{\ell}}} \]
      4. Applied rewrites89.7%

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

      if 1.00000000000000003e-139 < l < 9.5000000000000006e78

      1. Initial program 32.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. associate-*r/N/A

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

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

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

          \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
        5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 9.5000000000000006e78 < l

      1. Initial program 45.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. associate-*r/N/A

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

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

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

          \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
        5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin \color{blue}{k}}^{2} \cdot t\right) \cdot 2} \]
        7. lift-/.f6494.9

          \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
      8. Applied rewrites94.9%

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
        10. lift-pow.f64N/A

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

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

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

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

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

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

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

    Alternative 2: 93.6% accurate, 1.2× speedup?

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

      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 inf

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

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{1} - 1\right)} \]
        2. 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}}} \]
        3. Step-by-step derivation
          1. unpow2N/A

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k \cdot \ell} \cdot \color{blue}{\frac{{\sin k}^{2}}{\ell}}} \]
        4. Applied rewrites89.7%

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

        if 1.00000000000000003e-139 < l < 9.5000000000000006e78

        1. Initial program 32.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. associate-*r/N/A

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 9.5000000000000006e78 < l

        1. Initial program 45.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. associate-*r/N/A

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 94.6% accurate, 1.2× speedup?

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

        1. Initial program 36.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. associate-*r/N/A

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 5.00000000000000032e-159 < (*.f64 l l) < 4.99999999999999953e214

        1. Initial program 35.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. associate-*r/N/A

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 4.99999999999999953e214 < (*.f64 l l)

        1. Initial program 39.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. associate-*r/N/A

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\color{blue}{\left({\sin k}^{2} \cdot t\right) \cdot 2}} \]
        7. Step-by-step derivation
          1. lift-pow.f64N/A

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

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

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\sin k \cdot \sin k\right) \cdot t\right) \cdot 2} \]
          4. sqr-sin-aN/A

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          5. lower--.f64N/A

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          7. lower-cos.f64N/A

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          8. lower-*.f6492.4

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
        8. Applied rewrites92.4%

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

      Alternative 4: 93.6% accurate, 1.3× speedup?

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

        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 inf

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

            \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{1} - 1\right)} \]
          2. 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}}} \]
          3. Step-by-step derivation
            1. unpow2N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{2}{\frac{{k}^{2} \cdot t}{\cos k \cdot \ell} \cdot \color{blue}{\frac{{\sin k}^{2}}{\ell}}} \]
          4. Applied rewrites89.7%

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

          if 1.00000000000000003e-139 < l < 9.5000000000000006e78

          1. Initial program 32.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 9.5000000000000006e78 < l

          1. Initial program 45.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 87.9% accurate, 1.3× speedup?

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

          1. Initial program 38.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.0000000000000001e105 < k

          1. Initial program 29.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
            10. lift-pow.f64N/A

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

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

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

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

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

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

        Alternative 6: 88.5% accurate, 1.3× speedup?

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

          1. Initial program 39.3%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.50000000000000003e88 < k

          1. Initial program 26.2%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\color{blue}{\left({\sin k}^{2} \cdot t\right) \cdot 2}} \]
          7. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\sin k \cdot \sin k\right) \cdot t\right) \cdot 2} \]
            4. sqr-sin-aN/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            5. lower--.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            7. lower-cos.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            8. lower-*.f6492.7

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          8. Applied rewrites92.7%

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

        Alternative 7: 83.1% accurate, 1.6× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{\left(k \cdot t\right)} \cdot k} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \frac{\frac{{\ell}^{2}}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            4. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            5. times-fracN/A

              \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            6. pow2N/A

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

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            8. lift-/.f6479.1

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
          10. Applied rewrites79.1%

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

          if 2.7e-77 < k < 9.49999999999999998e-4

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

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

              \[\leadsto \frac{2}{\frac{{k}^{4} \cdot t}{\ell \cdot \color{blue}{\ell}}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{\color{blue}{t}}{\ell}} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}} \]
            6. lower-/.f6499.6

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\color{blue}{\ell}}} \]
          5. Applied rewrites99.6%

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

          if 9.49999999999999998e-4 < k

          1. Initial program 28.3%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\color{blue}{\left({\sin k}^{2} \cdot t\right) \cdot 2}} \]
          7. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\sin k \cdot \sin k\right) \cdot t\right) \cdot 2} \]
            4. sqr-sin-aN/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            5. lower--.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            7. lower-cos.f64N/A

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            8. lower-*.f6489.3

              \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          8. Applied rewrites89.3%

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

        Alternative 8: 83.1% accurate, 1.6× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{\left(k \cdot t\right)} \cdot k} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \frac{\frac{{\ell}^{2}}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            4. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            5. times-fracN/A

              \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            6. pow2N/A

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

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            8. lift-/.f6479.1

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
          10. Applied rewrites79.1%

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

          if 2.7e-77 < k < 9.49999999999999998e-4

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

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

              \[\leadsto \frac{2}{\frac{{k}^{4} \cdot t}{\ell \cdot \color{blue}{\ell}}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{\color{blue}{t}}{\ell}} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}} \]
            6. lower-/.f6499.6

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\color{blue}{\ell}}} \]
          5. Applied rewrites99.6%

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

          if 9.49999999999999998e-4 < k

          1. Initial program 28.3%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin \color{blue}{k}}^{2} \cdot t\right) \cdot 2} \]
            7. lift-/.f6489.8

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
          8. Applied rewrites89.8%

            \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left({\color{blue}{\sin k}}^{2} \cdot t\right) \cdot 2} \]
          9. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\sin k \cdot \sin k\right) \cdot t\right) \cdot 2} \]
            4. sqr-sin-aN/A

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            5. lower--.f64N/A

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            7. lower-cos.f64N/A

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
            8. lower-*.f6489.2

              \[\leadsto \frac{\left(\left(\cos k \cdot \frac{\ell}{k}\right) \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)\right) \cdot t\right) \cdot 2} \]
          10. Applied rewrites89.2%

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

        Alternative 9: 79.2% accurate, 1.7× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{\left(k \cdot t\right)} \cdot k} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \frac{\frac{{\ell}^{2}}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            4. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            5. times-fracN/A

              \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            6. pow2N/A

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

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            8. lift-/.f6479.1

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
          10. Applied rewrites79.1%

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

          if 2.7e-77 < k < 9.49999999999999998e-4

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

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

              \[\leadsto \frac{2}{\frac{{k}^{4} \cdot t}{\ell \cdot \color{blue}{\ell}}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{\color{blue}{t}}{\ell}} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}} \]
            6. lower-/.f6499.6

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\color{blue}{\ell}}} \]
          5. Applied rewrites99.6%

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

          if 9.49999999999999998e-4 < k

          1. Initial program 28.3%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{{\sin k}^{2}}}{\color{blue}{\left(k \cdot t\right) \cdot k}} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

              \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{\sin k \cdot \sin k}}{\left(k \cdot t\right) \cdot k} \]
            4. sqr-sin-aN/A

              \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)}}{\left(k \cdot t\right) \cdot k} \]
            5. lower--.f64N/A

              \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)}}{\left(k \cdot t\right) \cdot k} \]
            6. lower-*.f64N/A

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

              \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)}}{\left(k \cdot t\right) \cdot k} \]
            8. lower-*.f6483.2

              \[\leadsto \frac{2 \cdot \frac{\left(\cos k \cdot \ell\right) \cdot \ell}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}}{\left(k \cdot t\right) \cdot k} \]
          9. Applied rewrites83.2%

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

        Alternative 10: 79.2% accurate, 1.7× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{\left(k \cdot t\right)} \cdot k} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \frac{\frac{{\ell}^{2}}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            4. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            5. times-fracN/A

              \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            6. pow2N/A

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

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            8. lift-/.f6479.1

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
          10. Applied rewrites79.1%

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

          if 2.7e-77 < k < 9.49999999999999998e-4

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

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

              \[\leadsto \frac{2}{\frac{{k}^{4} \cdot t}{\ell \cdot \color{blue}{\ell}}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \color{blue}{\frac{t}{\ell}}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{\color{blue}{t}}{\ell}} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\ell}} \]
            6. lower-/.f6499.6

              \[\leadsto \frac{2}{\frac{{k}^{4}}{\ell} \cdot \frac{t}{\color{blue}{\ell}}} \]
          5. Applied rewrites99.6%

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

          if 9.49999999999999998e-4 < k

          1. Initial program 28.3%

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

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

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{{\sin k}^{2}} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

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

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

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

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

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)} \]
            8. lower-*.f6483.1

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)} \]
          9. Applied rewrites83.1%

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

        Alternative 11: 74.6% accurate, 2.8× speedup?

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

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

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

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

            \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
          5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left({k}^{2} \cdot t\right) \cdot 2} \]
        8. Step-by-step derivation
          1. pow2N/A

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

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

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

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2} \]
          5. lift-*.f6474.3

            \[\leadsto \frac{\left(\frac{\cos k \cdot \ell}{k} \cdot \frac{\ell}{k}\right) \cdot 4}{\left(\left(k \cdot t\right) \cdot k\right) \cdot 2} \]
        9. Applied rewrites74.3%

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

        Alternative 12: 73.1% accurate, 3.2× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{\left(k \cdot t\right)} \cdot k} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \frac{\frac{{\ell}^{2}}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            4. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            5. times-fracN/A

              \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            6. pow2N/A

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

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
            8. lift-/.f6479.2

              \[\leadsto \frac{{\left(\frac{\ell}{k}\right)}^{2} \cdot 2}{\left(k \cdot t\right) \cdot k} \]
          10. Applied rewrites79.2%

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

          if 4.39999999999999967e-30 < k

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6453.8

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites53.8%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            2. lift-/.f64N/A

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

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

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

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

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

        Alternative 13: 71.5% accurate, 3.3× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
          7. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{{k}^{2}} \]
            2. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
            3. times-fracN/A

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

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

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
            6. lower-/.f6477.3

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
          8. Applied rewrites77.3%

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

          if 4.39999999999999967e-30 < k

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6453.8

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites53.8%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            2. lift-/.f64N/A

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

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

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

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

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

        Alternative 14: 71.9% accurate, 3.3× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
          7. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{{k}^{2}} \]
            2. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
            3. times-fracN/A

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

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

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
            6. lower-/.f6477.1

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
          8. Applied rewrites77.1%

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

          if 2.7e-77 < k

          1. Initial program 27.7%

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6457.1

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites57.1%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            5. lift-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
            7. frac-timesN/A

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

              \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
            10. lower-*.f64N/A

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

              \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
            12. times-fracN/A

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

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

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            15. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            16. lower-/.f6460.9

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. Applied rewrites60.9%

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

        Alternative 15: 71.9% accurate, 7.7× speedup?

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

          1. Initial program 41.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
          7. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{{k}^{2}} \]
            2. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
            3. times-fracN/A

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

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

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
            6. lower-/.f6477.1

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \]
          8. Applied rewrites77.1%

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

          if 2.7e-77 < k

          1. Initial program 27.7%

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6457.1

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites57.1%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            5. lift-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
            7. frac-timesN/A

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

              \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
            10. lower-*.f64N/A

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

              \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
            12. times-fracN/A

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

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

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            15. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            16. lower-/.f6460.9

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. Applied rewrites60.9%

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot \color{blue}{2} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            2. metadata-evalN/A

              \[\leadsto \left(\frac{\ell}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            3. pow-prod-upN/A

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

              \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            5. pow2N/A

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

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            7. pow2N/A

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            8. lower-*.f6460.9

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          9. Applied rewrites60.9%

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

        Alternative 16: 69.1% accurate, 7.8× speedup?

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

          1. Initial program 35.3%

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6460.2

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites60.2%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            5. lift-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
            7. frac-timesN/A

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

              \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
            10. lower-*.f64N/A

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

              \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
            12. times-fracN/A

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

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

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            15. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            16. lower-/.f6471.0

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. Applied rewrites71.0%

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot \color{blue}{2} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            2. metadata-evalN/A

              \[\leadsto \left(\frac{\ell}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            3. pow-prod-upN/A

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

              \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            5. pow2N/A

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

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            7. pow2N/A

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            8. lower-*.f6470.9

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

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

          if 1.9e-169 < l

          1. Initial program 40.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}} \cdot 4}{\left(\color{blue}{{\sin k}^{2}} \cdot t\right) \cdot 2} \]
          8. Step-by-step derivation
            1. lower-/.f64N/A

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

              \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}} \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
            3. lift-*.f64N/A

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

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
            5. lower-*.f6468.2

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 4}{\left({\sin k}^{2} \cdot t\right) \cdot 2} \]
          9. Applied rewrites68.2%

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

            \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 4}{\left({k}^{2} \cdot t\right) \cdot 2} \]
          11. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 4}{\left(\left(k \cdot k\right) \cdot t\right) \cdot 2} \]
            2. lift-*.f6467.6

              \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot 4}{\left(\left(k \cdot k\right) \cdot t\right) \cdot 2} \]
          12. Applied rewrites67.6%

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

        Alternative 17: 69.0% accurate, 8.6× speedup?

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

          1. Initial program 35.3%

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6460.2

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites60.2%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            5. lift-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
            7. frac-timesN/A

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

              \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
            10. lower-*.f64N/A

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

              \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
            12. times-fracN/A

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

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

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            15. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            16. lower-/.f6471.0

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. Applied rewrites71.0%

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot \color{blue}{2} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            2. metadata-evalN/A

              \[\leadsto \left(\frac{\ell}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            3. pow-prod-upN/A

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

              \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            5. pow2N/A

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

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            7. pow2N/A

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            8. lower-*.f6470.9

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

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

          if 1.9e-169 < l

          1. Initial program 40.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{k}^{2} \cdot \left(\left(\frac{-1}{2} \cdot {\ell}^{2} + {k}^{2} \cdot \left(\frac{1}{24} \cdot {\ell}^{2} - \left(\frac{-1}{3} \cdot \left(\frac{-1}{2} \cdot {\ell}^{2} - \frac{-1}{3} \cdot {\ell}^{2}\right) + \frac{2}{45} \cdot {\ell}^{2}\right)\right)\right) - \frac{-1}{3} \cdot {\ell}^{2}\right) + {\ell}^{2}}{\color{blue}{{k}^{2}}} \]
          7. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{k}^{2} \cdot \left(\left(\frac{-1}{2} \cdot {\ell}^{2} + {k}^{2} \cdot \left(\frac{1}{24} \cdot {\ell}^{2} - \left(\frac{-1}{3} \cdot \left(\frac{-1}{2} \cdot {\ell}^{2} - \frac{-1}{3} \cdot {\ell}^{2}\right) + \frac{2}{45} \cdot {\ell}^{2}\right)\right)\right) - \frac{-1}{3} \cdot {\ell}^{2}\right) + {\ell}^{2}}{{k}^{\color{blue}{2}}} \]
          8. Applied rewrites38.0%

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

            \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2}}{k \cdot k} \]
          10. Step-by-step derivation
            1. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
            2. lift-*.f6467.6

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
          11. Applied rewrites67.6%

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

        Alternative 18: 69.0% accurate, 8.6× speedup?

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

          1. Initial program 35.3%

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

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

              \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
            2. times-fracN/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
            5. lower-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
            6. lower-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            8. lift-*.f6460.2

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. Applied rewrites60.2%

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
            2. lift-/.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
            3. lift-pow.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
            5. lift-/.f64N/A

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

              \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
            7. frac-timesN/A

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

              \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
            9. *-commutativeN/A

              \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
            10. lower-*.f64N/A

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

              \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
            12. times-fracN/A

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

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

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            15. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            16. lower-/.f6471.0

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. Applied rewrites71.0%

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot \color{blue}{2} \]
          8. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            2. metadata-evalN/A

              \[\leadsto \left(\frac{\ell}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            3. pow-prod-upN/A

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

              \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            5. pow2N/A

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

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            7. pow2N/A

              \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
            8. lower-*.f6470.9

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

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

          if 1.9e-169 < l

          1. Initial program 40.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. associate-*r/N/A

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

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

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

              \[\leadsto \frac{2}{{k}^{2} \cdot t} \cdot \color{blue}{\frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2}}} \]
            5. lower-/.f64N/A

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

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

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

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2} \cdot \cos \color{blue}{k}}{{\sin k}^{2}} \]
            9. lower-/.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{{\ell}^{2} \cdot \cos k}{\color{blue}{{\sin k}^{2}}} \]
            10. *-commutativeN/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot {\ell}^{2}}{{\color{blue}{\sin k}}^{2}} \]
            11. lower-*.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot {\ell}^{2}}{{\color{blue}{\sin k}}^{2}} \]
            12. lower-cos.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot {\ell}^{2}}{{\sin \color{blue}{k}}^{2}} \]
            13. pow2N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}} \]
            14. lift-*.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}} \]
            15. lower-pow.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{\color{blue}{2}}} \]
            16. lift-sin.f6482.9

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}} \]
          5. Applied rewrites82.9%

            \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\ell \cdot \ell\right)}{{\sin k}^{2}}} \]
          6. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \left(\color{blue}{\ell} \cdot \ell\right)}{{\sin k}^{2}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \cdot \frac{\cos k \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{{\sin k}^{2}} \]
            3. associate-*l*N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{{\sin k}^{2}} \]
            4. lower-*.f64N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{{\sin k}^{2}} \]
            5. lower-*.f6487.8

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \left(\ell \cdot \color{blue}{\ell}\right)}{{\sin k}^{2}} \]
          7. Applied rewrites87.8%

            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\cos k \cdot \color{blue}{\left(\ell \cdot \ell\right)}}{{\sin k}^{2}} \]
          8. Taylor expanded in k around 0

            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{{\ell}^{2}}{\color{blue}{{k}^{2}}} \]
          9. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{{\ell}^{2}}{{k}^{\color{blue}{2}}} \]
            2. pow2N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell \cdot \ell}{{k}^{2}} \]
            3. lift-*.f64N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell \cdot \ell}{{k}^{2}} \]
            4. pow2N/A

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
            5. lower-*.f6467.6

              \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell \cdot \ell}{k \cdot k} \]
          10. Applied rewrites67.6%

            \[\leadsto \frac{2}{k \cdot \left(k \cdot t\right)} \cdot \frac{\ell \cdot \ell}{\color{blue}{k \cdot k}} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 19: 67.1% accurate, 9.6× speedup?

        \[\begin{array}{l} l_m = \left|\ell\right| \\ \left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2 \end{array} \]
        l_m = (fabs.f64 l)
        (FPCore (t l_m k)
         :precision binary64
         (* (* (/ l_m (* (* k k) (* k k))) (/ l_m t)) 2.0))
        l_m = fabs(l);
        double code(double t, double l_m, double k) {
        	return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
        }
        
        l_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_m, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t
            real(8), intent (in) :: l_m
            real(8), intent (in) :: k
            code = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0d0
        end function
        
        l_m = Math.abs(l);
        public static double code(double t, double l_m, double k) {
        	return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
        }
        
        l_m = math.fabs(l)
        def code(t, l_m, k):
        	return ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0
        
        l_m = abs(l)
        function code(t, l_m, k)
        	return Float64(Float64(Float64(l_m / Float64(Float64(k * k) * Float64(k * k))) * Float64(l_m / t)) * 2.0)
        end
        
        l_m = abs(l);
        function tmp = code(t, l_m, k)
        	tmp = ((l_m / ((k * k) * (k * k))) * (l_m / t)) * 2.0;
        end
        
        l_m = N[Abs[l], $MachinePrecision]
        code[t_, l$95$m_, k_] := N[(N[(N[(l$95$m / N[(N[(k * k), $MachinePrecision] * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]
        
        \begin{array}{l}
        l_m = \left|\ell\right|
        
        \\
        \left(\frac{l\_m}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{l\_m}{t}\right) \cdot 2
        \end{array}
        
        Derivation
        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. associate-*r/N/A

            \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
          2. times-fracN/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
          4. lower-/.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{{\ell}^{2}}}{t} \]
          5. lower-pow.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{\color{blue}{2}}}{t} \]
          6. lower-/.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
          7. pow2N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          8. lift-*.f6461.6

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
        5. Applied rewrites61.6%

          \[\leadsto \color{blue}{\frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t}} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\color{blue}{\ell \cdot \ell}}{t} \]
          3. lift-pow.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \color{blue}{\ell}}{t} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
          5. lift-/.f64N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{\color{blue}{t}} \]
          6. pow2N/A

            \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{{\ell}^{2}}{t} \]
          7. frac-timesN/A

            \[\leadsto \frac{2 \cdot {\ell}^{2}}{\color{blue}{{k}^{4} \cdot t}} \]
          8. associate-*r/N/A

            \[\leadsto 2 \cdot \color{blue}{\frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
          9. *-commutativeN/A

            \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{{\ell}^{2}}{{k}^{4} \cdot t} \cdot \color{blue}{2} \]
          11. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{4} \cdot t} \cdot 2 \]
          12. times-fracN/A

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          13. lower-*.f64N/A

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          14. lower-/.f64N/A

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          15. lift-pow.f64N/A

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          16. lower-/.f6468.2

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
        7. Applied rewrites68.2%

          \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot \color{blue}{2} \]
        8. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto \left(\frac{\ell}{{k}^{4}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          2. metadata-evalN/A

            \[\leadsto \left(\frac{\ell}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          3. pow-prod-upN/A

            \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          4. lower-*.f64N/A

            \[\leadsto \left(\frac{\ell}{{k}^{2} \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          5. pow2N/A

            \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          6. lower-*.f64N/A

            \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          7. pow2N/A

            \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
          8. lower-*.f6468.2

            \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
        9. Applied rewrites68.2%

          \[\leadsto \left(\frac{\ell}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot \frac{\ell}{t}\right) \cdot 2 \]
        10. Add Preprocessing

        Alternative 20: 20.9% accurate, 21.0× speedup?

        \[\begin{array}{l} l_m = \left|\ell\right| \\ \frac{-0.11666666666666667 \cdot \left(l\_m \cdot l\_m\right)}{t} \end{array} \]
        l_m = (fabs.f64 l)
        (FPCore (t l_m k)
         :precision binary64
         (/ (* -0.11666666666666667 (* l_m l_m)) t))
        l_m = fabs(l);
        double code(double t, double l_m, double k) {
        	return (-0.11666666666666667 * (l_m * l_m)) / t;
        }
        
        l_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_m, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t
            real(8), intent (in) :: l_m
            real(8), intent (in) :: k
            code = ((-0.11666666666666667d0) * (l_m * l_m)) / t
        end function
        
        l_m = Math.abs(l);
        public static double code(double t, double l_m, double k) {
        	return (-0.11666666666666667 * (l_m * l_m)) / t;
        }
        
        l_m = math.fabs(l)
        def code(t, l_m, k):
        	return (-0.11666666666666667 * (l_m * l_m)) / t
        
        l_m = abs(l)
        function code(t, l_m, k)
        	return Float64(Float64(-0.11666666666666667 * Float64(l_m * l_m)) / t)
        end
        
        l_m = abs(l);
        function tmp = code(t, l_m, k)
        	tmp = (-0.11666666666666667 * (l_m * l_m)) / t;
        end
        
        l_m = N[Abs[l], $MachinePrecision]
        code[t_, l$95$m_, k_] := N[(N[(-0.11666666666666667 * N[(l$95$m * l$95$m), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
        
        \begin{array}{l}
        l_m = \left|\ell\right|
        
        \\
        \frac{-0.11666666666666667 \cdot \left(l\_m \cdot l\_m\right)}{t}
        \end{array}
        
        Derivation
        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}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
        5. Applied rewrites28.6%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2 \cdot \left(k \cdot k\right), \frac{\ell \cdot \ell}{t} \cdot 0.058333333333333334, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right), k \cdot k, \frac{\ell \cdot \ell}{t} \cdot 2\right)}{{k}^{4}}} \]
        6. Taylor expanded in k around inf

          \[\leadsto \frac{-7}{60} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
        7. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
          2. pow2N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          4. lift-*.f6420.8

            \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
        8. Applied rewrites20.8%

          \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{\color{blue}{t}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          4. pow2N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{t} \]
          5. associate-*r/N/A

            \[\leadsto \frac{\frac{-7}{60} \cdot {\ell}^{2}}{t} \]
          6. lower-/.f64N/A

            \[\leadsto \frac{\frac{-7}{60} \cdot {\ell}^{2}}{t} \]
          7. lower-*.f64N/A

            \[\leadsto \frac{\frac{-7}{60} \cdot {\ell}^{2}}{t} \]
          8. pow2N/A

            \[\leadsto \frac{\frac{-7}{60} \cdot \left(\ell \cdot \ell\right)}{t} \]
          9. lift-*.f6420.8

            \[\leadsto \frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t} \]
        10. Applied rewrites20.8%

          \[\leadsto \frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t} \]
        11. Add Preprocessing

        Alternative 21: 20.9% accurate, 21.0× speedup?

        \[\begin{array}{l} l_m = \left|\ell\right| \\ -0.11666666666666667 \cdot \frac{l\_m \cdot l\_m}{t} \end{array} \]
        l_m = (fabs.f64 l)
        (FPCore (t l_m k)
         :precision binary64
         (* -0.11666666666666667 (/ (* l_m l_m) t)))
        l_m = fabs(l);
        double code(double t, double l_m, double k) {
        	return -0.11666666666666667 * ((l_m * l_m) / t);
        }
        
        l_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_m, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t
            real(8), intent (in) :: l_m
            real(8), intent (in) :: k
            code = (-0.11666666666666667d0) * ((l_m * l_m) / t)
        end function
        
        l_m = Math.abs(l);
        public static double code(double t, double l_m, double k) {
        	return -0.11666666666666667 * ((l_m * l_m) / t);
        }
        
        l_m = math.fabs(l)
        def code(t, l_m, k):
        	return -0.11666666666666667 * ((l_m * l_m) / t)
        
        l_m = abs(l)
        function code(t, l_m, k)
        	return Float64(-0.11666666666666667 * Float64(Float64(l_m * l_m) / t))
        end
        
        l_m = abs(l);
        function tmp = code(t, l_m, k)
        	tmp = -0.11666666666666667 * ((l_m * l_m) / t);
        end
        
        l_m = N[Abs[l], $MachinePrecision]
        code[t_, l$95$m_, k_] := N[(-0.11666666666666667 * N[(N[(l$95$m * l$95$m), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        l_m = \left|\ell\right|
        
        \\
        -0.11666666666666667 \cdot \frac{l\_m \cdot l\_m}{t}
        \end{array}
        
        Derivation
        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}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
        5. Applied rewrites28.6%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2 \cdot \left(k \cdot k\right), \frac{\ell \cdot \ell}{t} \cdot 0.058333333333333334, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right), k \cdot k, \frac{\ell \cdot \ell}{t} \cdot 2\right)}{{k}^{4}}} \]
        6. Taylor expanded in k around inf

          \[\leadsto \frac{-7}{60} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
        7. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
          2. pow2N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          4. lift-*.f6420.8

            \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
        8. Applied rewrites20.8%

          \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
        9. Add Preprocessing

        Alternative 22: 18.7% accurate, 21.0× speedup?

        \[\begin{array}{l} l_m = \left|\ell\right| \\ -0.11666666666666667 \cdot \left(l\_m \cdot \frac{l\_m}{t}\right) \end{array} \]
        l_m = (fabs.f64 l)
        (FPCore (t l_m k)
         :precision binary64
         (* -0.11666666666666667 (* l_m (/ l_m t))))
        l_m = fabs(l);
        double code(double t, double l_m, double k) {
        	return -0.11666666666666667 * (l_m * (l_m / t));
        }
        
        l_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_m, k)
        use fmin_fmax_functions
            real(8), intent (in) :: t
            real(8), intent (in) :: l_m
            real(8), intent (in) :: k
            code = (-0.11666666666666667d0) * (l_m * (l_m / t))
        end function
        
        l_m = Math.abs(l);
        public static double code(double t, double l_m, double k) {
        	return -0.11666666666666667 * (l_m * (l_m / t));
        }
        
        l_m = math.fabs(l)
        def code(t, l_m, k):
        	return -0.11666666666666667 * (l_m * (l_m / t))
        
        l_m = abs(l)
        function code(t, l_m, k)
        	return Float64(-0.11666666666666667 * Float64(l_m * Float64(l_m / t)))
        end
        
        l_m = abs(l);
        function tmp = code(t, l_m, k)
        	tmp = -0.11666666666666667 * (l_m * (l_m / t));
        end
        
        l_m = N[Abs[l], $MachinePrecision]
        code[t_, l$95$m_, k_] := N[(-0.11666666666666667 * N[(l$95$m * N[(l$95$m / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        l_m = \left|\ell\right|
        
        \\
        -0.11666666666666667 \cdot \left(l\_m \cdot \frac{l\_m}{t}\right)
        \end{array}
        
        Derivation
        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}{\frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{{k}^{4}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(-2 \cdot \left({k}^{2} \cdot \left(\frac{-1}{36} \cdot \frac{{\ell}^{2}}{t} + \frac{31}{360} \cdot \frac{{\ell}^{2}}{t}\right)\right) + \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right)}{\color{blue}{{k}^{4}}} \]
        5. Applied rewrites28.6%

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(-2 \cdot \left(k \cdot k\right), \frac{\ell \cdot \ell}{t} \cdot 0.058333333333333334, \frac{\ell \cdot \ell}{t} \cdot -0.3333333333333333\right), k \cdot k, \frac{\ell \cdot \ell}{t} \cdot 2\right)}{{k}^{4}}} \]
        6. Taylor expanded in k around inf

          \[\leadsto \frac{-7}{60} \cdot \color{blue}{\frac{{\ell}^{2}}{t}} \]
        7. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{{\ell}^{2}}{\color{blue}{t}} \]
          2. pow2N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          3. lift-/.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          4. lift-*.f6420.8

            \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
        8. Applied rewrites20.8%

          \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \frac{\ell \cdot \ell}{t} \]
          3. associate-/l*N/A

            \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
          4. lower-*.f64N/A

            \[\leadsto \frac{-7}{60} \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
          5. lift-/.f6419.4

            \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \]
        10. Applied rewrites19.4%

          \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
        11. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025051 
        (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))))