Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.9% → 93.1%
Time: 9.4s
Alternatives: 22
Speedup: 9.6×

Specification

?
\[\mathsf{TRUE}\left(\right)\]
\[\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.9% 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.1% accurate, 1.3× speedup?

\[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := {\sin k}^{2}\\ \mathbf{if}\;l\_m \leq 2 \cdot 10^{-162}:\\ \;\;\;\;\frac{2}{t} \cdot \left(\frac{l\_m}{k} \cdot \frac{\frac{l\_m}{t\_1}}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot t} \cdot \left(\frac{\cos k \cdot l\_m}{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)))
   (if (<= l_m 2e-162)
     (* (/ 2.0 t) (* (/ l_m k) (/ (/ l_m t_1) k)))
     (* (/ 2.0 (* t_1 t)) (* (/ (* (cos k) l_m) 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 tmp;
	if (l_m <= 2e-162) {
		tmp = (2.0 / t) * ((l_m / k) * ((l_m / t_1) / k));
	} else {
		tmp = (2.0 / (t_1 * t)) * (((cos(k) * l_m) / 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) :: tmp
    t_1 = sin(k) ** 2.0d0
    if (l_m <= 2d-162) then
        tmp = (2.0d0 / t) * ((l_m / k) * ((l_m / t_1) / k))
    else
        tmp = (2.0d0 / (t_1 * t)) * (((cos(k) * l_m) / 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 tmp;
	if (l_m <= 2e-162) {
		tmp = (2.0 / t) * ((l_m / k) * ((l_m / t_1) / k));
	} else {
		tmp = (2.0 / (t_1 * t)) * (((Math.cos(k) * l_m) / 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)
	tmp = 0
	if l_m <= 2e-162:
		tmp = (2.0 / t) * ((l_m / k) * ((l_m / t_1) / k))
	else:
		tmp = (2.0 / (t_1 * t)) * (((math.cos(k) * l_m) / k) * (l_m / k))
	return tmp
l_m = abs(l)
function code(t, l_m, k)
	t_1 = sin(k) ^ 2.0
	tmp = 0.0
	if (l_m <= 2e-162)
		tmp = Float64(Float64(2.0 / t) * Float64(Float64(l_m / k) * Float64(Float64(l_m / t_1) / k)));
	else
		tmp = Float64(Float64(2.0 / Float64(t_1 * t)) * Float64(Float64(Float64(cos(k) * l_m) / 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;
	tmp = 0.0;
	if (l_m <= 2e-162)
		tmp = (2.0 / t) * ((l_m / k) * ((l_m / t_1) / k));
	else
		tmp = (2.0 / (t_1 * t)) * (((cos(k) * l_m) / 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]}, If[LessEqual[l$95$m, 2e-162], N[(N[(2.0 / t), $MachinePrecision] * N[(N[(l$95$m / k), $MachinePrecision] * N[(N[(l$95$m / t$95$1), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / 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}\\
\mathbf{if}\;l\_m \leq 2 \cdot 10^{-162}:\\
\;\;\;\;\frac{2}{t} \cdot \left(\frac{l\_m}{k} \cdot \frac{\frac{l\_m}{t\_1}}{k}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.99999999999999991e-162

    1. Initial program 29.5%

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

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

        \[\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.8%

      \[\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. associate-*l/N/A

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
    9. Step-by-step derivation
      1. Applied rewrites59.4%

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

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

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

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

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

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

          \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
        7. associate-/l*N/A

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

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

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

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

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

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

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

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

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

      if 1.99999999999999991e-162 < l

      1. Initial program 41.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.f6489.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 rewrites89.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 \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 rewrites98.4%

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

    Alternative 2: 92.4% accurate, 1.3× speedup?

    \[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \sin k \cdot k\\ \frac{2}{t} \cdot \left(\frac{\cos k \cdot l\_m}{t\_1} \cdot \frac{l\_m}{t\_1}\right) \end{array} \end{array} \]
    l_m = (fabs.f64 l)
    (FPCore (t l_m k)
     :precision binary64
     (let* ((t_1 (* (sin k) k)))
       (* (/ 2.0 t) (* (/ (* (cos k) l_m) t_1) (/ l_m t_1)))))
    l_m = fabs(l);
    double code(double t, double l_m, double k) {
    	double t_1 = sin(k) * k;
    	return (2.0 / t) * (((cos(k) * l_m) / t_1) * (l_m / t_1));
    }
    
    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
        t_1 = sin(k) * k
        code = (2.0d0 / t) * (((cos(k) * l_m) / t_1) * (l_m / t_1))
    end function
    
    l_m = Math.abs(l);
    public static double code(double t, double l_m, double k) {
    	double t_1 = Math.sin(k) * k;
    	return (2.0 / t) * (((Math.cos(k) * l_m) / t_1) * (l_m / t_1));
    }
    
    l_m = math.fabs(l)
    def code(t, l_m, k):
    	t_1 = math.sin(k) * k
    	return (2.0 / t) * (((math.cos(k) * l_m) / t_1) * (l_m / t_1))
    
    l_m = abs(l)
    function code(t, l_m, k)
    	t_1 = Float64(sin(k) * k)
    	return Float64(Float64(2.0 / t) * Float64(Float64(Float64(cos(k) * l_m) / t_1) * Float64(l_m / t_1)))
    end
    
    l_m = abs(l);
    function tmp = code(t, l_m, k)
    	t_1 = sin(k) * k;
    	tmp = (2.0 / t) * (((cos(k) * l_m) / t_1) * (l_m / t_1));
    end
    
    l_m = N[Abs[l], $MachinePrecision]
    code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]}, N[(N[(2.0 / t), $MachinePrecision] * N[(N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / t$95$1), $MachinePrecision] * N[(l$95$m / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    l_m = \left|\ell\right|
    
    \\
    \begin{array}{l}
    t_1 := \sin k \cdot k\\
    \frac{2}{t} \cdot \left(\frac{\cos k \cdot l\_m}{t\_1} \cdot \frac{l\_m}{t\_1}\right)
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 33.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.f6475.6

        \[\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.6%

      \[\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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} \cdot \frac{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2}}}{\color{blue}{{\sin k}^{2}}} \]
    9. Applied rewrites94.1%

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

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

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

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

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

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

        \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\cos k \cdot \ell}{k}}{{\sin k}^{2}} \]
      7. frac-timesN/A

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

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

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

        \[\leadsto \frac{2}{t} \cdot \frac{\frac{\cos k \cdot {\ell}^{2}}{k \cdot k}}{{\sin k}^{2}} \]
      11. *-commutativeN/A

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

        \[\leadsto \frac{2}{t} \cdot \frac{\frac{{\ell}^{2} \cdot \cos k}{{k}^{2}}}{{\sin k}^{2}} \]
      13. lift-pow.f64N/A

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

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

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

        \[\leadsto \frac{2}{t} \cdot \frac{{\ell}^{2} \cdot \cos k}{{\sin k}^{2} \cdot \color{blue}{{k}^{2}}} \]
      17. unpow-prod-downN/A

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

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

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

    Alternative 3: 89.2% 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.75 \cdot 10^{+39}:\\ \;\;\;\;\left(\frac{t\_1}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{{\sin k}^{2}}\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} \cdot \frac{\frac{l\_m}{k} \cdot \frac{t\_1}{k}}{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
     (let* ((t_1 (* (cos k) l_m)))
       (if (<= k 1.75e+39)
         (* (* (/ t_1 (* (* k k) t)) (/ l_m (pow (sin k) 2.0))) 2.0)
         (*
          (/ 2.0 t)
          (/ (* (/ l_m k) (/ t_1 k)) (- 0.5 (* 0.5 (cos (* 2.0 k)))))))))
    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.75e+39) {
    		tmp = ((t_1 / ((k * k) * t)) * (l_m / pow(sin(k), 2.0))) * 2.0;
    	} else {
    		tmp = (2.0 / t) * (((l_m / k) * (t_1 / k)) / (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) :: t_1
        real(8) :: tmp
        t_1 = cos(k) * l_m
        if (k <= 1.75d+39) then
            tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ** 2.0d0))) * 2.0d0
        else
            tmp = (2.0d0 / t) * (((l_m / k) * (t_1 / k)) / (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 t_1 = Math.cos(k) * l_m;
    	double tmp;
    	if (k <= 1.75e+39) {
    		tmp = ((t_1 / ((k * k) * t)) * (l_m / Math.pow(Math.sin(k), 2.0))) * 2.0;
    	} else {
    		tmp = (2.0 / t) * (((l_m / k) * (t_1 / k)) / (0.5 - (0.5 * Math.cos((2.0 * k)))));
    	}
    	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.75e+39:
    		tmp = ((t_1 / ((k * k) * t)) * (l_m / math.pow(math.sin(k), 2.0))) * 2.0
    	else:
    		tmp = (2.0 / t) * (((l_m / k) * (t_1 / k)) / (0.5 - (0.5 * math.cos((2.0 * k)))))
    	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.75e+39)
    		tmp = Float64(Float64(Float64(t_1 / Float64(Float64(k * k) * t)) * Float64(l_m / (sin(k) ^ 2.0))) * 2.0);
    	else
    		tmp = Float64(Float64(2.0 / t) * Float64(Float64(Float64(l_m / k) * Float64(t_1 / k)) / 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)
    	t_1 = cos(k) * l_m;
    	tmp = 0.0;
    	if (k <= 1.75e+39)
    		tmp = ((t_1 / ((k * k) * t)) * (l_m / (sin(k) ^ 2.0))) * 2.0;
    	else
    		tmp = (2.0 / t) * (((l_m / k) * (t_1 / k)) / (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_] := Block[{t$95$1 = N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision]}, If[LessEqual[k, 1.75e+39], 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[(2.0 / t), $MachinePrecision] * N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(t$95$1 / k), $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}
    t_1 := \cos k \cdot l\_m\\
    \mathbf{if}\;k \leq 1.75 \cdot 10^{+39}:\\
    \;\;\;\;\left(\frac{t\_1}{\left(k \cdot k\right) \cdot t} \cdot \frac{l\_m}{{\sin k}^{2}}\right) \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{2}{t} \cdot \frac{\frac{l\_m}{k} \cdot \frac{t\_1}{k}}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 1.7500000000000001e39

      1. Initial program 34.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.f6474.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 rewrites74.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. 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 rewrites88.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.7500000000000001e39 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 82.1% accurate, 1.7× speedup?

    \[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t} \cdot \frac{\frac{l\_m}{k} \cdot \frac{\cos k \cdot l\_m}{k}}{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 7e-5)
       (* (/ (/ 2.0 t) k) (/ (* l_m (/ l_m (pow (sin k) 2.0))) k))
       (*
        (/ 2.0 t)
        (/ (* (/ l_m k) (/ (* (cos k) l_m) k)) (- 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 <= 7e-5) {
    		tmp = ((2.0 / t) / k) * ((l_m * (l_m / pow(sin(k), 2.0))) / k);
    	} else {
    		tmp = (2.0 / t) * (((l_m / k) * ((cos(k) * l_m) / k)) / (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 <= 7d-5) then
            tmp = ((2.0d0 / t) / k) * ((l_m * (l_m / (sin(k) ** 2.0d0))) / k)
        else
            tmp = (2.0d0 / t) * (((l_m / k) * ((cos(k) * l_m) / k)) / (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 <= 7e-5) {
    		tmp = ((2.0 / t) / k) * ((l_m * (l_m / Math.pow(Math.sin(k), 2.0))) / k);
    	} else {
    		tmp = (2.0 / t) * (((l_m / k) * ((Math.cos(k) * l_m) / k)) / (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 <= 7e-5:
    		tmp = ((2.0 / t) / k) * ((l_m * (l_m / math.pow(math.sin(k), 2.0))) / k)
    	else:
    		tmp = (2.0 / t) * (((l_m / k) * ((math.cos(k) * l_m) / k)) / (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 <= 7e-5)
    		tmp = Float64(Float64(Float64(2.0 / t) / k) * Float64(Float64(l_m * Float64(l_m / (sin(k) ^ 2.0))) / k));
    	else
    		tmp = Float64(Float64(2.0 / t) * Float64(Float64(Float64(l_m / k) * Float64(Float64(cos(k) * l_m) / k)) / 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 <= 7e-5)
    		tmp = ((2.0 / t) / k) * ((l_m * (l_m / (sin(k) ^ 2.0))) / k);
    	else
    		tmp = (2.0 / t) * (((l_m / k) * ((cos(k) * l_m) / k)) / (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, 7e-5], N[(N[(N[(2.0 / t), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l$95$m * N[(l$95$m / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / t), $MachinePrecision] * N[(N[(N[(l$95$m / k), $MachinePrecision] * N[(N[(N[Cos[k], $MachinePrecision] * l$95$m), $MachinePrecision] / k), $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 7 \cdot 10^{-5}:\\
    \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{2}{t} \cdot \frac{\frac{l\_m}{k} \cdot \frac{\cos k \cdot l\_m}{k}}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 6.9999999999999994e-5

      1. Initial program 34.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.f6472.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 rewrites72.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\color{blue}{\frac{\ell \cdot \ell}{{\sin k}^{2}}}}{k} \]
          10. lower-/.f6467.3

            \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{\color{blue}{k}} \]
        3. Applied rewrites82.3%

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

        if 6.9999999999999994e-5 < k

        1. Initial program 31.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.f6483.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 rewrites83.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 5: 82.1% accurate, 1.7× speedup?

      \[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\ \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 7e-5)
         (* (/ (/ 2.0 t) k) (/ (* l_m (/ l_m (pow (sin k) 2.0))) k))
         (/
          (* (* (/ (* (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 <= 7e-5) {
      		tmp = ((2.0 / t) / k) * ((l_m * (l_m / pow(sin(k), 2.0))) / k);
      	} 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 <= 7d-5) then
              tmp = ((2.0d0 / t) / k) * ((l_m * (l_m / (sin(k) ** 2.0d0))) / k)
          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 <= 7e-5) {
      		tmp = ((2.0 / t) / k) * ((l_m * (l_m / Math.pow(Math.sin(k), 2.0))) / k);
      	} 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 <= 7e-5:
      		tmp = ((2.0 / t) / k) * ((l_m * (l_m / math.pow(math.sin(k), 2.0))) / k)
      	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 <= 7e-5)
      		tmp = Float64(Float64(Float64(2.0 / t) / k) * Float64(Float64(l_m * Float64(l_m / (sin(k) ^ 2.0))) / k));
      	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 <= 7e-5)
      		tmp = ((2.0 / t) / k) * ((l_m * (l_m / (sin(k) ^ 2.0))) / k);
      	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, 7e-5], N[(N[(N[(2.0 / t), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l$95$m * N[(l$95$m / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $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 7 \cdot 10^{-5}:\\
      \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\
      
      \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 2 regimes
      2. if k < 6.9999999999999994e-5

        1. Initial program 34.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.f6472.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 rewrites72.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\color{blue}{\frac{\ell \cdot \ell}{{\sin k}^{2}}}}{k} \]
            10. lower-/.f6467.3

              \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{\color{blue}{k}} \]
          3. Applied rewrites82.3%

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

          if 6.9999999999999994e-5 < k

          1. Initial program 31.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.f6483.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 rewrites83.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 rewrites96.1%

            \[\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-*.f6495.9

              \[\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 rewrites95.9%

            \[\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} \]
        10. Recombined 2 regimes into one program.
        11. Add Preprocessing

        Alternative 6: 77.2% accurate, 1.7× speedup?

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

          1. Initial program 34.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.f6472.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 rewrites72.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\color{blue}{\frac{\ell \cdot \ell}{{\sin k}^{2}}}}{k} \]
              10. lower-/.f6467.3

                \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{\color{blue}{k}} \]
            3. Applied rewrites82.3%

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

            if 6.9999999999999994e-5 < k

            1. Initial program 31.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.f6483.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 rewrites83.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 77.1% accurate, 1.7× speedup?

          \[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} \mathbf{if}\;k \leq 7 \cdot 10^{-5}:\\ \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \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 7e-5)
             (* (/ (/ 2.0 t) k) (/ (* l_m (/ l_m (pow (sin k) 2.0))) k))
             (*
              (/ 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 <= 7e-5) {
          		tmp = ((2.0 / t) / k) * ((l_m * (l_m / pow(sin(k), 2.0))) / k);
          	} 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 <= 7d-5) then
                  tmp = ((2.0d0 / t) / k) * ((l_m * (l_m / (sin(k) ** 2.0d0))) / k)
              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 <= 7e-5) {
          		tmp = ((2.0 / t) / k) * ((l_m * (l_m / Math.pow(Math.sin(k), 2.0))) / k);
          	} 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 <= 7e-5:
          		tmp = ((2.0 / t) / k) * ((l_m * (l_m / math.pow(math.sin(k), 2.0))) / k)
          	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 <= 7e-5)
          		tmp = Float64(Float64(Float64(2.0 / t) / k) * Float64(Float64(l_m * Float64(l_m / (sin(k) ^ 2.0))) / k));
          	else
          		tmp = Float64(Float64(2.0 / Float64(Float64(k * 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 <= 7e-5)
          		tmp = ((2.0 / t) / k) * ((l_m * (l_m / (sin(k) ^ 2.0))) / k);
          	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, 7e-5], N[(N[(N[(2.0 / t), $MachinePrecision] / k), $MachinePrecision] * N[(N[(l$95$m * N[(l$95$m / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[(k * k), $MachinePrecision] * t), $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 7 \cdot 10^{-5}:\\
          \;\;\;\;\frac{\frac{2}{t}}{k} \cdot \frac{l\_m \cdot \frac{l\_m}{{\sin k}^{2}}}{k}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot t} \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 2 regimes
          2. if k < 6.9999999999999994e-5

            1. Initial program 34.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.f6472.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 rewrites72.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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\color{blue}{\frac{\ell \cdot \ell}{{\sin k}^{2}}}}{k} \]
                10. lower-/.f6467.3

                  \[\leadsto \frac{\frac{2}{t}}{k} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{\color{blue}{k}} \]
              3. Applied rewrites82.3%

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

              if 6.9999999999999994e-5 < k

              1. Initial program 31.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.f6483.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 rewrites83.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-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}}} \]
                2. 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}} \]
                3. unpow2N/A

                  \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot t} \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}{\left(k \cdot k\right) \cdot t} \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}{\left(k \cdot k\right) \cdot t} \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}{\left(k \cdot k\right) \cdot t} \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}{\left(k \cdot k\right) \cdot t} \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.7

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

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

            Alternative 8: 74.9% accurate, 1.8× speedup?

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

                \[\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.6%

              \[\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. associate-*l/N/A

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

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

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

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

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

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

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

              \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
            9. Step-by-step derivation
              1. Applied rewrites65.5%

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

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

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

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

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

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

                  \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                7. associate-/l*N/A

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

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

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

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

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

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

                  \[\leadsto \frac{2}{t} \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\ell}{{\sin k}^{2}}}{k}\right) \]
                14. lift-pow.f6478.4

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

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

              Alternative 9: 74.9% accurate, 1.8× speedup?

              \[\begin{array}{l} l_m = \left|\ell\right| \\ \begin{array}{l} t_1 := \frac{l\_m}{\sin k \cdot k}\\ \frac{2}{t} \cdot \left(t\_1 \cdot t\_1\right) \end{array} \end{array} \]
              l_m = (fabs.f64 l)
              (FPCore (t l_m k)
               :precision binary64
               (let* ((t_1 (/ l_m (* (sin k) k)))) (* (/ 2.0 t) (* t_1 t_1))))
              l_m = fabs(l);
              double code(double t, double l_m, double k) {
              	double t_1 = l_m / (sin(k) * k);
              	return (2.0 / t) * (t_1 * t_1);
              }
              
              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
                  t_1 = l_m / (sin(k) * k)
                  code = (2.0d0 / t) * (t_1 * t_1)
              end function
              
              l_m = Math.abs(l);
              public static double code(double t, double l_m, double k) {
              	double t_1 = l_m / (Math.sin(k) * k);
              	return (2.0 / t) * (t_1 * t_1);
              }
              
              l_m = math.fabs(l)
              def code(t, l_m, k):
              	t_1 = l_m / (math.sin(k) * k)
              	return (2.0 / t) * (t_1 * t_1)
              
              l_m = abs(l)
              function code(t, l_m, k)
              	t_1 = Float64(l_m / Float64(sin(k) * k))
              	return Float64(Float64(2.0 / t) * Float64(t_1 * t_1))
              end
              
              l_m = abs(l);
              function tmp = code(t, l_m, k)
              	t_1 = l_m / (sin(k) * k);
              	tmp = (2.0 / t) * (t_1 * t_1);
              end
              
              l_m = N[Abs[l], $MachinePrecision]
              code[t_, l$95$m_, k_] := Block[{t$95$1 = N[(l$95$m / N[(N[Sin[k], $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, N[(N[(2.0 / t), $MachinePrecision] * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              l_m = \left|\ell\right|
              
              \\
              \begin{array}{l}
              t_1 := \frac{l\_m}{\sin k \cdot k}\\
              \frac{2}{t} \cdot \left(t\_1 \cdot t\_1\right)
              \end{array}
              \end{array}
              
              Derivation
              1. Initial program 33.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.f6475.6

                  \[\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.6%

                \[\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. associate-*l/N/A

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

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

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

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

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

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

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

                \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
              9. Step-by-step derivation
                1. Applied rewrites65.5%

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

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

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

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

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

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

                    \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{{k}^{2}} \]
                  7. associate-/l/N/A

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

                    \[\leadsto \frac{2}{t} \cdot \frac{\ell \cdot \ell}{\color{blue}{{\sin k}^{2}} \cdot {k}^{2}} \]
                  9. unpow-prod-downN/A

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

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

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

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

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

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

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

                    \[\leadsto \frac{2}{t} \cdot \left(\frac{\ell}{\sin k \cdot k} \cdot \frac{\ell}{\color{blue}{\sin k \cdot k}}\right) \]
                3. Applied rewrites78.4%

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

                Alternative 10: 73.1% accurate, 1.8× speedup?

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

                  1. Initial program 29.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.f6468.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 rewrites68.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 \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. associate-*l/N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                    2. Taylor expanded in k around 0

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

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

                        \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
                      3. times-fracN/A

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

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

                        \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot k} \]
                      6. lift-/.f6476.8

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

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

                    if 5.00000000000000033e-153 < l

                    1. Initial program 41.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.f6488.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 rewrites88.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{{\ell}^{2}}{{\color{blue}{\sin 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}{{\sin k}^{2}} \]
                      2. lift-*.f6477.6

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

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

                  Alternative 11: 73.4% accurate, 1.8× speedup?

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

                      \[\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.6%

                    \[\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. associate-*l/N/A

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

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

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

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

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

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

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

                    \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                  9. Step-by-step derivation
                    1. Applied rewrites65.5%

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{\frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k} \cdot 2}{\color{blue}{k \cdot t}} \]
                    3. Applied rewrites78.2%

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

                    Alternative 12: 74.0% accurate, 1.8× speedup?

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

                        \[\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.6%

                      \[\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. associate-*l/N/A

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

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

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

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

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

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

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

                      \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                    9. Step-by-step derivation
                      1. Applied rewrites65.5%

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

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

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

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

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

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

                          \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{{k}^{2}} \]
                        7. associate-/l/N/A

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 72.6% accurate, 1.9× speedup?

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

                        1. Initial program 28.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.f6470.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 rewrites70.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 \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. associate-*l/N/A

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                          2. Taylor expanded in k around 0

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

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

                              \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
                            3. times-fracN/A

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

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

                              \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot k} \]
                            6. lift-/.f6490.2

                              \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot k} \]
                          4. Applied rewrites90.2%

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

                          if 1.99999999999999982e-21 < (*.f64 l l)

                          1. Initial program 38.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.f6480.8

                              \[\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 rewrites80.8%

                            \[\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. associate-*l/N/A

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

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

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

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

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

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

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

                            \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                          9. Step-by-step derivation
                            1. Applied rewrites64.8%

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{{k}^{2}} \cdot \frac{2}{t} \]
                              9. associate-/l/N/A

                                \[\leadsto \frac{\ell \cdot \ell}{{\sin k}^{2} \cdot {k}^{2}} \cdot \frac{\color{blue}{2}}{t} \]
                              10. unpow-prod-downN/A

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

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

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

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

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

                          Alternative 14: 72.5% accurate, 1.9× speedup?

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

                              \[\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.6%

                            \[\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. associate-*l/N/A

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

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

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

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

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

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

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

                            \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                          9. Step-by-step derivation
                            1. Applied rewrites65.5%

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}} \cdot 2}{\color{blue}{{k}^{2} \cdot t}} \]
                            3. Applied rewrites77.1%

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

                            Alternative 15: 72.6% accurate, 2.8× speedup?

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

                              1. Initial program 34.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.f6473.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 rewrites73.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. 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-/.f6479.6

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

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

                              if 2200 < k

                              1. Initial program 31.5%

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

                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
                              4. Step-by-step derivation
                                1. 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.f6483.6

                                  \[\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 rewrites83.6%

                                \[\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. associate-*l/N/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{t} \cdot \frac{\frac{\left(\cos k \cdot \ell\right) \cdot \ell}{k \cdot k}}{k \cdot k} \]
                                2. lift-*.f6463.7

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

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

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

                            Alternative 16: 72.5% accurate, 7.0× speedup?

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

                              1. Initial program 31.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.f6472.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 rewrites72.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. 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. associate-*l/N/A

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

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

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

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

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

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

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

                                \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                              9. Step-by-step derivation
                                1. Applied rewrites63.5%

                                  \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{{\sin k}^{2}}}{k \cdot k} \]
                                2. Taylor expanded in k around 0

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

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

                                    \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
                                  3. times-fracN/A

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

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

                                    \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot k} \]
                                  6. lift-/.f6478.3

                                    \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{k \cdot k} \]
                                4. Applied rewrites78.3%

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

                                if 4.9999999999999999e-20 < l

                                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 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-*.f6467.8

                                    \[\leadsto \frac{2}{{k}^{4}} \cdot \frac{\ell \cdot \ell}{t} \]
                                5. Applied rewrites67.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 \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. associate-*l/N/A

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

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

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

                                    \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
                                  8. metadata-evalN/A

                                    \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{\left(2 + \color{blue}{2}\right)}} \]
                                  9. pow-prod-upN/A

                                    \[\leadsto \frac{2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{2} \cdot \color{blue}{{k}^{2}}} \]
                                  10. *-commutativeN/A

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

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

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

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

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

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

                                    \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{{k}^{2}} \cdot \frac{2}{{k}^{2}} \]
                                  17. pow2N/A

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

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

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

                                    \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{k \cdot k} \cdot \frac{2}{k \cdot \color{blue}{k}} \]
                                  21. lift-*.f6470.7

                                    \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{k \cdot k} \cdot \frac{2}{k \cdot \color{blue}{k}} \]
                                7. Applied rewrites70.7%

                                  \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{k \cdot k} \cdot \color{blue}{\frac{2}{k \cdot k}} \]
                              10. Recombined 2 regimes into one program.
                              11. Add Preprocessing

                              Alternative 17: 71.9% accurate, 8.6× speedup?

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

                                  \[\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.6%

                                \[\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-/.f6475.0

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

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

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

                              Alternative 18: 64.6% accurate, 8.6× speedup?

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

                                  \[\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.6%

                                \[\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. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
                                5. lift-*.f6464.6

                                  \[\leadsto \frac{2}{t} \cdot \frac{\frac{\ell \cdot \ell}{k \cdot k}}{k \cdot k} \]
                              10. Applied rewrites64.6%

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

                              Alternative 19: 60.9% accurate, 9.6× speedup?

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

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

                                \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
                              4. Step-by-step derivation
                                1. 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.1

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

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

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

                                  \[\leadsto \frac{2}{{k}^{\left(2 + 2\right)}} \cdot \frac{\ell \cdot \ell}{t} \]
                                3. pow-prod-upN/A

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

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

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

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

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

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

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

                              Alternative 20: 20.7% 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 33.9%

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

                                \[\leadsto \color{blue}{\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 rewrites29.4%

                                \[\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-*.f6416.7

                                  \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
                              8. Applied rewrites16.7%

                                \[\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-*.f6416.7

                                  \[\leadsto \frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t} \]
                              10. Applied rewrites16.7%

                                \[\leadsto \frac{-0.11666666666666667 \cdot \left(\ell \cdot \ell\right)}{t} \]
                              11. Add Preprocessing

                              Alternative 21: 20.7% 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 33.9%

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

                                \[\leadsto \color{blue}{\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 rewrites29.4%

                                \[\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-*.f6416.7

                                  \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
                              8. Applied rewrites16.7%

                                \[\leadsto -0.11666666666666667 \cdot \color{blue}{\frac{\ell \cdot \ell}{t}} \]
                              9. Add Preprocessing

                              Alternative 22: 18.6% 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 33.9%

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

                                \[\leadsto \color{blue}{\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 rewrites29.4%

                                \[\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-*.f6416.7

                                  \[\leadsto -0.11666666666666667 \cdot \frac{\ell \cdot \ell}{t} \]
                              8. Applied rewrites16.7%

                                \[\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. lower-/.f6416.0

                                  \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{t}\right) \]
                              10. Applied rewrites16.0%

                                \[\leadsto -0.11666666666666667 \cdot \left(\ell \cdot \frac{\ell}{\color{blue}{t}}\right) \]
                              11. Add Preprocessing

                              Reproduce

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