Toniolo and Linder, Equation (10-)

Percentage Accurate: 37.3% → 85.9%
Time: 4.2s
Alternatives: 11
Speedup: 10.3×

Specification

?
\[\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)} \]
(FPCore (t l k)
  :precision binary64
  (/
 2
 (*
  (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
  (- (+ 1 (pow (/ k t) 2)) 1))))
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 / N[(N[(N[(N[(N[Power[t, 3], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1 + N[Power[N[(k / t), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)}

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 11 alternatives:

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

Initial Program: 37.3% accurate, 1.0× speedup?

\[\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)} \]
(FPCore (t l k)
  :precision binary64
  (/
 2
 (*
  (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k))
  (- (+ 1 (pow (/ k t) 2)) 1))))
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 / N[(N[(N[(N[(N[Power[t, 3], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1 + N[Power[N[(k / t), $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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)}

Alternative 1: 85.9% accurate, 1.3× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq \frac{3232509030581985}{316912650057057350374175801344}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos \left(\left|k\right|\right)}{\left(\left(\left|k\right| \cdot t\right) \cdot \left|k\right|\right) \cdot {\sin \left(\left|k\right|\right)}^{2}}\right)\right)\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs k) 3232509030581985/316912650057057350374175801344)
  (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
  (*
   2
   (*
    l
    (*
     l
     (/
      (cos (fabs k))
      (* (* (* (fabs k) t) (fabs k)) (pow (sin (fabs k)) 2))))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(k) <= 1.02e-14) {
		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (cos(fabs(k)) / (((fabs(k) * t) * fabs(k)) * pow(sin(fabs(k)), 2.0)))));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(k) <= 1.02d-14) then
        tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
    else
        tmp = 2.0d0 * (l * (l * (cos(abs(k)) / (((abs(k) * t) * abs(k)) * (sin(abs(k)) ** 2.0d0)))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(k) <= 1.02e-14) {
		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (Math.cos(Math.abs(k)) / (((Math.abs(k) * t) * Math.abs(k)) * Math.pow(Math.sin(Math.abs(k)), 2.0)))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(k) <= 1.02e-14:
		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
	else:
		tmp = 2.0 * (l * (l * (math.cos(math.fabs(k)) / (((math.fabs(k) * t) * math.fabs(k)) * math.pow(math.sin(math.fabs(k)), 2.0)))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(k) <= 1.02e-14)
		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
	else
		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(abs(k)) / Float64(Float64(Float64(abs(k) * t) * abs(k)) * (sin(abs(k)) ^ 2.0))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(k) <= 1.02e-14)
		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
	else
		tmp = 2.0 * (l * (l * (cos(abs(k)) / (((abs(k) * t) * abs(k)) * (sin(abs(k)) ^ 2.0)))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 3232509030581985/316912650057057350374175801344], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2 * N[(l * N[(l * N[(N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Abs[k], $MachinePrecision] * t), $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[Sin[N[Abs[k], $MachinePrecision]], $MachinePrecision], 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{3232509030581985}{316912650057057350374175801344}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\

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


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
      14. pow-flipN/A

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      16. metadata-eval68.0%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
    6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      11. lower-*.f6468.0%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites68.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      8. lower-*.f6468.6%

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
    10. Applied rewrites68.6%

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

    if 1.02e-14 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
      19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right)}\right)\right) \]
      6. sqr-sin-a-revN/A

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin k}^{\color{blue}{2}}}\right)\right) \]
      10. lower-pow.f6482.1%

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

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

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

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

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

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

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

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

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

Alternative 2: 85.5% accurate, 1.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos \left(\left|k\right|\right)}{\left|k\right| \cdot \left(\left(\left|k\right| \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right)\right)}\right)\right)\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs k) 5902958103587057/295147905179352825856)
  (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
  (*
   2
   (*
    l
    (*
     l
     (/
      (cos (fabs k))
      (*
       (fabs k)
       (*
        (* (fabs k) t)
        (- 1/2 (* (cos (+ (fabs k) (fabs k))) 1/2))))))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(k) <= 2e-5) {
		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (cos(fabs(k)) / (fabs(k) * ((fabs(k) * t) * (0.5 - (cos((fabs(k) + fabs(k))) * 0.5)))))));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(k) <= 2d-5) then
        tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
    else
        tmp = 2.0d0 * (l * (l * (cos(abs(k)) / (abs(k) * ((abs(k) * t) * (0.5d0 - (cos((abs(k) + abs(k))) * 0.5d0)))))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(k) <= 2e-5) {
		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (Math.cos(Math.abs(k)) / (Math.abs(k) * ((Math.abs(k) * t) * (0.5 - (Math.cos((Math.abs(k) + Math.abs(k))) * 0.5)))))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(k) <= 2e-5:
		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
	else:
		tmp = 2.0 * (l * (l * (math.cos(math.fabs(k)) / (math.fabs(k) * ((math.fabs(k) * t) * (0.5 - (math.cos((math.fabs(k) + math.fabs(k))) * 0.5)))))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(k) <= 2e-5)
		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
	else
		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(abs(k)) / Float64(abs(k) * Float64(Float64(abs(k) * t) * Float64(0.5 - Float64(cos(Float64(abs(k) + abs(k))) * 0.5))))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(k) <= 2e-5)
		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
	else
		tmp = 2.0 * (l * (l * (cos(abs(k)) / (abs(k) * ((abs(k) * t) * (0.5 - (cos((abs(k) + abs(k))) * 0.5)))))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 5902958103587057/295147905179352825856], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2 * N[(l * N[(l * N[(N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision] / N[(N[Abs[k], $MachinePrecision] * N[(N[(N[Abs[k], $MachinePrecision] * t), $MachinePrecision] * N[(1/2 - N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos \left(\left|k\right|\right)}{\left|k\right| \cdot \left(\left(\left|k\right| \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right)\right)}\right)\right)\\


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
      14. pow-flipN/A

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      16. metadata-eval68.0%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
    6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      11. lower-*.f6468.0%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites68.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      8. lower-*.f6468.6%

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
    10. Applied rewrites68.6%

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

    if 2.0000000000000002e-5 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
      19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{k \cdot \left(\left(k \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(k + k\right) \cdot \color{blue}{\frac{1}{2}}\right)\right)}\right)\right) \]
      11. lower-*.f6479.9%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{k \cdot \left(\left(k \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(k + k\right) \cdot \color{blue}{\frac{1}{2}}\right)\right)}\right)\right) \]
    8. Applied rewrites79.9%

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

Alternative 3: 85.5% accurate, 1.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos \left(\left|k\right|\right)}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right)\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs k) 5902958103587057/295147905179352825856)
  (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
  (*
   2
   (*
    l
    (*
     l
     (/
      (cos (fabs k))
      (*
       (fabs k)
       (*
        (fabs k)
        (* (- 1/2 (* (cos (+ (fabs k) (fabs k))) 1/2)) t)))))))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(k) <= 2e-5) {
		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (cos(fabs(k)) / (fabs(k) * (fabs(k) * ((0.5 - (cos((fabs(k) + fabs(k))) * 0.5)) * t))))));
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(k) <= 2d-5) then
        tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
    else
        tmp = 2.0d0 * (l * (l * (cos(abs(k)) / (abs(k) * (abs(k) * ((0.5d0 - (cos((abs(k) + abs(k))) * 0.5d0)) * t))))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(k) <= 2e-5) {
		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
	} else {
		tmp = 2.0 * (l * (l * (Math.cos(Math.abs(k)) / (Math.abs(k) * (Math.abs(k) * ((0.5 - (Math.cos((Math.abs(k) + Math.abs(k))) * 0.5)) * t))))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(k) <= 2e-5:
		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
	else:
		tmp = 2.0 * (l * (l * (math.cos(math.fabs(k)) / (math.fabs(k) * (math.fabs(k) * ((0.5 - (math.cos((math.fabs(k) + math.fabs(k))) * 0.5)) * t))))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(k) <= 2e-5)
		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
	else
		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(cos(abs(k)) / Float64(abs(k) * Float64(abs(k) * Float64(Float64(0.5 - Float64(cos(Float64(abs(k) + abs(k))) * 0.5)) * t)))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(k) <= 2e-5)
		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
	else
		tmp = 2.0 * (l * (l * (cos(abs(k)) / (abs(k) * (abs(k) * ((0.5 - (cos((abs(k) + abs(k))) * 0.5)) * t))))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 5902958103587057/295147905179352825856], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2 * N[(l * N[(l * N[(N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision] / N[(N[Abs[k], $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] * N[(N[(1/2 - N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1/2), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos \left(\left|k\right|\right)}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right)\\


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
      14. pow-flipN/A

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      16. metadata-eval68.0%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
    6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      11. lower-*.f6468.0%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites68.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      8. lower-*.f6468.6%

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
    10. Applied rewrites68.6%

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

    if 2.0000000000000002e-5 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
      19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot \color{blue}{t}\right)\right)}\right)\right) \]
      9. lower-*.f6479.9%

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \cos \left(k + k\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right) \]
      12. lower-*.f6479.9%

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

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

Alternative 4: 81.0% accurate, 1.7× speedup?

\[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\ell + \ell\right) \cdot \left(\frac{\cos \left(\left|k\right|\right)}{\left(\left(\left|k\right| \cdot \left|k\right|\right) \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right)} \cdot \ell\right)\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (if (<= (fabs k) 5902958103587057/295147905179352825856)
  (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
  (*
   (+ l l)
   (*
    (/
     (cos (fabs k))
     (*
      (* (* (fabs k) (fabs k)) t)
      (- 1/2 (* (cos (+ (fabs k) (fabs k))) 1/2))))
    l))))
double code(double t, double l, double k) {
	double tmp;
	if (fabs(k) <= 2e-5) {
		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
	} else {
		tmp = (l + l) * ((cos(fabs(k)) / (((fabs(k) * fabs(k)) * t) * (0.5 - (cos((fabs(k) + fabs(k))) * 0.5)))) * l);
	}
	return tmp;
}
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
    real(8) :: tmp
    if (abs(k) <= 2d-5) then
        tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
    else
        tmp = (l + l) * ((cos(abs(k)) / (((abs(k) * abs(k)) * t) * (0.5d0 - (cos((abs(k) + abs(k))) * 0.5d0)))) * l)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (Math.abs(k) <= 2e-5) {
		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
	} else {
		tmp = (l + l) * ((Math.cos(Math.abs(k)) / (((Math.abs(k) * Math.abs(k)) * t) * (0.5 - (Math.cos((Math.abs(k) + Math.abs(k))) * 0.5)))) * l);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if math.fabs(k) <= 2e-5:
		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
	else:
		tmp = (l + l) * ((math.cos(math.fabs(k)) / (((math.fabs(k) * math.fabs(k)) * t) * (0.5 - (math.cos((math.fabs(k) + math.fabs(k))) * 0.5)))) * l)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (abs(k) <= 2e-5)
		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
	else
		tmp = Float64(Float64(l + l) * Float64(Float64(cos(abs(k)) / Float64(Float64(Float64(abs(k) * abs(k)) * t) * Float64(0.5 - Float64(cos(Float64(abs(k) + abs(k))) * 0.5)))) * l));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (abs(k) <= 2e-5)
		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
	else
		tmp = (l + l) * ((cos(abs(k)) / (((abs(k) * abs(k)) * t) * (0.5 - (cos((abs(k) + abs(k))) * 0.5)))) * l);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 5902958103587057/295147905179352825856], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(l + l), $MachinePrecision] * N[(N[(N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision] / N[(N[(N[(N[Abs[k], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * N[(1/2 - N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\

\mathbf{else}:\\
\;\;\;\;\left(\ell + \ell\right) \cdot \left(\frac{\cos \left(\left|k\right|\right)}{\left(\left(\left|k\right| \cdot \left|k\right|\right) \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right)} \cdot \ell\right)\\


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
      14. pow-flipN/A

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      16. metadata-eval68.0%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
    6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      11. lower-*.f6468.0%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites68.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      8. lower-*.f6468.6%

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
    10. Applied rewrites68.6%

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

    if 2.0000000000000002e-5 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\color{blue}{\ell} \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right)}\right) \]
      12. lower-+.f6475.4%

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right)} \cdot \color{blue}{\ell}\right) \]
      15. lower-*.f6475.4%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right)} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites75.4%

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

Alternative 5: 79.5% accurate, 1.7× speedup?

\[\begin{array}{l} t_1 := \frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\\ \mathbf{if}\;\left|k\right| \leq \frac{6611313076017503}{18889465931478580854784}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{elif}\;\left|k\right| \leq 2599999999999999887664419758914981348248264558110438907623871487291307107521407186203396720649953589050594995308390975919897425922250547981431031080157184:\\ \;\;\;\;\cos \left(\left|k\right|\right) \cdot \frac{\left(\ell + \ell\right) \cdot \ell}{\left(\left(\left|k\right| \cdot \left|k\right|\right) \cdot t\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(t\_1 \cdot t\right)\right)}\right)\right)\\ \end{array} \]
(FPCore (t l k)
  :precision binary64
  (let* ((t_1 (- 1/2 (* (cos (+ (fabs k) (fabs k))) 1/2))))
  (if (<= (fabs k) 6611313076017503/18889465931478580854784)
    (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
    (if (<=
         (fabs k)
         2599999999999999887664419758914981348248264558110438907623871487291307107521407186203396720649953589050594995308390975919897425922250547981431031080157184)
      (*
       (cos (fabs k))
       (/ (* (+ l l) l) (* (* (* (fabs k) (fabs k)) t) t_1)))
      (* 2 (* l (* l (/ 1 (* (fabs k) (* (fabs k) (* t_1 t)))))))))))
double code(double t, double l, double k) {
	double t_1 = 0.5 - (cos((fabs(k) + fabs(k))) * 0.5);
	double tmp;
	if (fabs(k) <= 3.5e-7) {
		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
	} else if (fabs(k) <= 2.6e+153) {
		tmp = cos(fabs(k)) * (((l + l) * l) / (((fabs(k) * fabs(k)) * t) * t_1));
	} else {
		tmp = 2.0 * (l * (l * (1.0 / (fabs(k) * (fabs(k) * (t_1 * t))))));
	}
	return tmp;
}
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
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 0.5d0 - (cos((abs(k) + abs(k))) * 0.5d0)
    if (abs(k) <= 3.5d-7) then
        tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
    else if (abs(k) <= 2.6d+153) then
        tmp = cos(abs(k)) * (((l + l) * l) / (((abs(k) * abs(k)) * t) * t_1))
    else
        tmp = 2.0d0 * (l * (l * (1.0d0 / (abs(k) * (abs(k) * (t_1 * t))))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double t_1 = 0.5 - (Math.cos((Math.abs(k) + Math.abs(k))) * 0.5);
	double tmp;
	if (Math.abs(k) <= 3.5e-7) {
		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
	} else if (Math.abs(k) <= 2.6e+153) {
		tmp = Math.cos(Math.abs(k)) * (((l + l) * l) / (((Math.abs(k) * Math.abs(k)) * t) * t_1));
	} else {
		tmp = 2.0 * (l * (l * (1.0 / (Math.abs(k) * (Math.abs(k) * (t_1 * t))))));
	}
	return tmp;
}
def code(t, l, k):
	t_1 = 0.5 - (math.cos((math.fabs(k) + math.fabs(k))) * 0.5)
	tmp = 0
	if math.fabs(k) <= 3.5e-7:
		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
	elif math.fabs(k) <= 2.6e+153:
		tmp = math.cos(math.fabs(k)) * (((l + l) * l) / (((math.fabs(k) * math.fabs(k)) * t) * t_1))
	else:
		tmp = 2.0 * (l * (l * (1.0 / (math.fabs(k) * (math.fabs(k) * (t_1 * t))))))
	return tmp
function code(t, l, k)
	t_1 = Float64(0.5 - Float64(cos(Float64(abs(k) + abs(k))) * 0.5))
	tmp = 0.0
	if (abs(k) <= 3.5e-7)
		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
	elseif (abs(k) <= 2.6e+153)
		tmp = Float64(cos(abs(k)) * Float64(Float64(Float64(l + l) * l) / Float64(Float64(Float64(abs(k) * abs(k)) * t) * t_1)));
	else
		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(1.0 / Float64(abs(k) * Float64(abs(k) * Float64(t_1 * t)))))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	t_1 = 0.5 - (cos((abs(k) + abs(k))) * 0.5);
	tmp = 0.0;
	if (abs(k) <= 3.5e-7)
		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
	elseif (abs(k) <= 2.6e+153)
		tmp = cos(abs(k)) * (((l + l) * l) / (((abs(k) * abs(k)) * t) * t_1));
	else
		tmp = 2.0 * (l * (l * (1.0 / (abs(k) * (abs(k) * (t_1 * t))))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := Block[{t$95$1 = N[(1/2 - N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1/2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[k], $MachinePrecision], 6611313076017503/18889465931478580854784], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[Abs[k], $MachinePrecision], 2599999999999999887664419758914981348248264558110438907623871487291307107521407186203396720649953589050594995308390975919897425922250547981431031080157184], N[(N[Cos[N[Abs[k], $MachinePrecision]], $MachinePrecision] * N[(N[(N[(l + l), $MachinePrecision] * l), $MachinePrecision] / N[(N[(N[(N[Abs[k], $MachinePrecision] * N[Abs[k], $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2 * N[(l * N[(l * N[(1 / N[(N[Abs[k], $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] * N[(t$95$1 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\\
\mathbf{if}\;\left|k\right| \leq \frac{6611313076017503}{18889465931478580854784}:\\
\;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\

\mathbf{elif}\;\left|k\right| \leq 2599999999999999887664419758914981348248264558110438907623871487291307107521407186203396720649953589050594995308390975919897425922250547981431031080157184:\\
\;\;\;\;\cos \left(\left|k\right|\right) \cdot \frac{\left(\ell + \ell\right) \cdot \ell}{\left(\left(\left|k\right| \cdot \left|k\right|\right) \cdot t\right) \cdot t\_1}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(t\_1 \cdot t\right)\right)}\right)\right)\\


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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
      5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
      14. pow-flipN/A

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
      16. metadata-eval68.0%

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
    6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      11. lower-*.f6468.0%

        \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
    8. Applied rewrites68.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      8. lower-*.f6468.6%

        \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
    10. Applied rewrites68.6%

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

    if 3.4999999999999998e-7 < k < 2.5999999999999999e153

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \cos k \cdot \color{blue}{\frac{\left(\ell \cdot \ell\right) \cdot 2}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right)}} \]
      6. lower-/.f6467.8%

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

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

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

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

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

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

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

        \[\leadsto \cos k \cdot \frac{\left(\ell + \ell\right) \cdot \ell}{\left(\color{blue}{\left(k \cdot k\right)} \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right)} \]
      14. lower-+.f6467.8%

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

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

        \[\leadsto \cos k \cdot \frac{\left(\ell + \ell\right) \cdot \ell}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \cos \left(k + k\right) \cdot \color{blue}{\frac{1}{2}}\right)} \]
      17. lower-*.f6467.8%

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

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

    if 2.5999999999999999e153 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
      19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot \color{blue}{t}\right)\right)}\right)\right) \]
        9. lower-*.f6465.2%

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \cos \left(k + k\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right) \]
        12. lift-*.f6465.2%

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \cos \left(k + k\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right) \]
      3. Applied rewrites65.2%

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

    Alternative 6: 70.8% accurate, 2.7× speedup?

    \[\begin{array}{l} \mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\ \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right)\\ \end{array} \]
    (FPCore (t l k)
      :precision binary64
      (if (<= (fabs k) 5902958103587057/295147905179352825856)
      (/ (* (+ l l) (* (pow (fabs k) -4) l)) t)
      (*
       2
       (*
        l
        (*
         l
         (/
          1
          (*
           (fabs k)
           (*
            (fabs k)
            (* (- 1/2 (* (cos (+ (fabs k) (fabs k))) 1/2)) t)))))))))
    double code(double t, double l, double k) {
    	double tmp;
    	if (fabs(k) <= 2e-5) {
    		tmp = ((l + l) * (pow(fabs(k), -4.0) * l)) / t;
    	} else {
    		tmp = 2.0 * (l * (l * (1.0 / (fabs(k) * (fabs(k) * ((0.5 - (cos((fabs(k) + fabs(k))) * 0.5)) * t))))));
    	}
    	return tmp;
    }
    
    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
        real(8) :: tmp
        if (abs(k) <= 2d-5) then
            tmp = ((l + l) * ((abs(k) ** (-4.0d0)) * l)) / t
        else
            tmp = 2.0d0 * (l * (l * (1.0d0 / (abs(k) * (abs(k) * ((0.5d0 - (cos((abs(k) + abs(k))) * 0.5d0)) * t))))))
        end if
        code = tmp
    end function
    
    public static double code(double t, double l, double k) {
    	double tmp;
    	if (Math.abs(k) <= 2e-5) {
    		tmp = ((l + l) * (Math.pow(Math.abs(k), -4.0) * l)) / t;
    	} else {
    		tmp = 2.0 * (l * (l * (1.0 / (Math.abs(k) * (Math.abs(k) * ((0.5 - (Math.cos((Math.abs(k) + Math.abs(k))) * 0.5)) * t))))));
    	}
    	return tmp;
    }
    
    def code(t, l, k):
    	tmp = 0
    	if math.fabs(k) <= 2e-5:
    		tmp = ((l + l) * (math.pow(math.fabs(k), -4.0) * l)) / t
    	else:
    		tmp = 2.0 * (l * (l * (1.0 / (math.fabs(k) * (math.fabs(k) * ((0.5 - (math.cos((math.fabs(k) + math.fabs(k))) * 0.5)) * t))))))
    	return tmp
    
    function code(t, l, k)
    	tmp = 0.0
    	if (abs(k) <= 2e-5)
    		tmp = Float64(Float64(Float64(l + l) * Float64((abs(k) ^ -4.0) * l)) / t);
    	else
    		tmp = Float64(2.0 * Float64(l * Float64(l * Float64(1.0 / Float64(abs(k) * Float64(abs(k) * Float64(Float64(0.5 - Float64(cos(Float64(abs(k) + abs(k))) * 0.5)) * t)))))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(t, l, k)
    	tmp = 0.0;
    	if (abs(k) <= 2e-5)
    		tmp = ((l + l) * ((abs(k) ^ -4.0) * l)) / t;
    	else
    		tmp = 2.0 * (l * (l * (1.0 / (abs(k) * (abs(k) * ((0.5 - (cos((abs(k) + abs(k))) * 0.5)) * t))))));
    	end
    	tmp_2 = tmp;
    end
    
    code[t_, l_, k_] := If[LessEqual[N[Abs[k], $MachinePrecision], 5902958103587057/295147905179352825856], N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[N[Abs[k], $MachinePrecision], -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(2 * N[(l * N[(l * N[(1 / N[(N[Abs[k], $MachinePrecision] * N[(N[Abs[k], $MachinePrecision] * N[(N[(1/2 - N[(N[Cos[N[(N[Abs[k], $MachinePrecision] + N[Abs[k], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 1/2), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    \mathbf{if}\;\left|k\right| \leq \frac{5902958103587057}{295147905179352825856}:\\
    \;\;\;\;\frac{\left(\ell + \ell\right) \cdot \left({\left(\left|k\right|\right)}^{-4} \cdot \ell\right)}{t}\\
    
    \mathbf{else}:\\
    \;\;\;\;2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left|k\right| \cdot \left(\left|k\right| \cdot \left(\left(\frac{1}{2} - \cos \left(\left|k\right| + \left|k\right|\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right)\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if k < 2.0000000000000002e-5

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

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

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

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

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

          \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
        5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
        14. pow-flipN/A

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
        16. metadata-eval68.0%

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
      6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
        11. lower-*.f6468.0%

          \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
      8. Applied rewrites68.0%

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
        8. lower-*.f6468.6%

          \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
      10. Applied rewrites68.6%

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

      if 2.0000000000000002e-5 < k

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
        19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(k + k\right)\right) \cdot \color{blue}{t}\right)\right)}\right)\right) \]
          9. lower-*.f6465.2%

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \cos \left(k + k\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right) \]
          12. lift-*.f6465.2%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{k \cdot \left(k \cdot \left(\left(\frac{1}{2} - \cos \left(k + k\right) \cdot \frac{1}{2}\right) \cdot t\right)\right)}\right)\right) \]
        3. Applied rewrites65.2%

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

      Alternative 7: 69.9% accurate, 2.9× speedup?

      \[\begin{array}{l} \mathbf{if}\;\left|\ell\right| \leq 999999999999999967336168804116691273849533185806555472917961779471295845921727862608739868455469056:\\ \;\;\;\;\frac{\left(\left|\ell\right| + \left|\ell\right|\right) \cdot \left({k}^{-4} \cdot \left|\ell\right|\right)}{t}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2}\right)} \cdot \left(\left(\left|\ell\right| \cdot \left|\ell\right|\right) \cdot 2\right)\\ \end{array} \]
      (FPCore (t l k)
        :precision binary64
        (if (<=
           (fabs l)
           999999999999999967336168804116691273849533185806555472917961779471295845921727862608739868455469056)
        (/ (* (+ (fabs l) (fabs l)) (* (pow k -4) (fabs l))) t)
        (*
         (/ (cos k) (* (* (* k k) t) (- 1/2 1/2)))
         (* (* (fabs l) (fabs l)) 2))))
      double code(double t, double l, double k) {
      	double tmp;
      	if (fabs(l) <= 1e+99) {
      		tmp = ((fabs(l) + fabs(l)) * (pow(k, -4.0) * fabs(l))) / t;
      	} else {
      		tmp = (cos(k) / (((k * k) * t) * (0.5 - 0.5))) * ((fabs(l) * fabs(l)) * 2.0);
      	}
      	return tmp;
      }
      
      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
          real(8) :: tmp
          if (abs(l) <= 1d+99) then
              tmp = ((abs(l) + abs(l)) * ((k ** (-4.0d0)) * abs(l))) / t
          else
              tmp = (cos(k) / (((k * k) * t) * (0.5d0 - 0.5d0))) * ((abs(l) * abs(l)) * 2.0d0)
          end if
          code = tmp
      end function
      
      public static double code(double t, double l, double k) {
      	double tmp;
      	if (Math.abs(l) <= 1e+99) {
      		tmp = ((Math.abs(l) + Math.abs(l)) * (Math.pow(k, -4.0) * Math.abs(l))) / t;
      	} else {
      		tmp = (Math.cos(k) / (((k * k) * t) * (0.5 - 0.5))) * ((Math.abs(l) * Math.abs(l)) * 2.0);
      	}
      	return tmp;
      }
      
      def code(t, l, k):
      	tmp = 0
      	if math.fabs(l) <= 1e+99:
      		tmp = ((math.fabs(l) + math.fabs(l)) * (math.pow(k, -4.0) * math.fabs(l))) / t
      	else:
      		tmp = (math.cos(k) / (((k * k) * t) * (0.5 - 0.5))) * ((math.fabs(l) * math.fabs(l)) * 2.0)
      	return tmp
      
      function code(t, l, k)
      	tmp = 0.0
      	if (abs(l) <= 1e+99)
      		tmp = Float64(Float64(Float64(abs(l) + abs(l)) * Float64((k ^ -4.0) * abs(l))) / t);
      	else
      		tmp = Float64(Float64(cos(k) / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - 0.5))) * Float64(Float64(abs(l) * abs(l)) * 2.0));
      	end
      	return tmp
      end
      
      function tmp_2 = code(t, l, k)
      	tmp = 0.0;
      	if (abs(l) <= 1e+99)
      		tmp = ((abs(l) + abs(l)) * ((k ^ -4.0) * abs(l))) / t;
      	else
      		tmp = (cos(k) / (((k * k) * t) * (0.5 - 0.5))) * ((abs(l) * abs(l)) * 2.0);
      	end
      	tmp_2 = tmp;
      end
      
      code[t_, l_, k_] := If[LessEqual[N[Abs[l], $MachinePrecision], 999999999999999967336168804116691273849533185806555472917961779471295845921727862608739868455469056], N[(N[(N[(N[Abs[l], $MachinePrecision] + N[Abs[l], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, -4], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(N[(N[Cos[k], $MachinePrecision] / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(1/2 - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Abs[l], $MachinePrecision] * N[Abs[l], $MachinePrecision]), $MachinePrecision] * 2), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      \mathbf{if}\;\left|\ell\right| \leq 999999999999999967336168804116691273849533185806555472917961779471295845921727862608739868455469056:\\
      \;\;\;\;\frac{\left(\left|\ell\right| + \left|\ell\right|\right) \cdot \left({k}^{-4} \cdot \left|\ell\right|\right)}{t}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2}\right)} \cdot \left(\left(\left|\ell\right| \cdot \left|\ell\right|\right) \cdot 2\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if l < 9.9999999999999997e98

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

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
          5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
          14. pow-flipN/A

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
          16. metadata-eval68.0%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
        6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
          11. lower-*.f6468.0%

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
        8. Applied rewrites68.0%

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
          8. lower-*.f6468.6%

            \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
        10. Applied rewrites68.6%

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

        if 9.9999999999999997e98 < l

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 69.0% accurate, 3.7× speedup?

        \[\frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
        (FPCore (t l k)
          :precision binary64
          (/ (* (+ l l) (* (pow k -4) l)) t))
        double code(double t, double l, double k) {
        	return ((l + l) * (pow(k, -4.0) * l)) / t;
        }
        
        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 = ((l + l) * ((k ** (-4.0d0)) * l)) / t
        end function
        
        public static double code(double t, double l, double k) {
        	return ((l + l) * (Math.pow(k, -4.0) * l)) / t;
        }
        
        def code(t, l, k):
        	return ((l + l) * (math.pow(k, -4.0) * l)) / t
        
        function code(t, l, k)
        	return Float64(Float64(Float64(l + l) * Float64((k ^ -4.0) * l)) / t)
        end
        
        function tmp = code(t, l, k)
        	tmp = ((l + l) * ((k ^ -4.0) * l)) / t;
        end
        
        code[t_, l_, k_] := N[(N[(N[(l + l), $MachinePrecision] * N[(N[Power[k, -4], $MachinePrecision] * l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
        
        \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t}
        
        Derivation
        1. Initial program 37.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. Taylor expanded in k around 0

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
          5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
          14. pow-flipN/A

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
          16. metadata-eval68.0%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
        6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
          11. lower-*.f6468.0%

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
        8. Applied rewrites68.0%

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
          8. lower-*.f6468.6%

            \[\leadsto \frac{\left(\ell + \ell\right) \cdot \left({k}^{-4} \cdot \ell\right)}{t} \]
        10. Applied rewrites68.6%

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

        Alternative 9: 68.6% accurate, 3.7× speedup?

        \[\left(\ell + \ell\right) \cdot \frac{{k}^{-4} \cdot \ell}{t} \]
        (FPCore (t l k)
          :precision binary64
          (* (+ l l) (/ (* (pow k -4) l) t)))
        double code(double t, double l, double k) {
        	return (l + l) * ((pow(k, -4.0) * l) / t);
        }
        
        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 = (l + l) * (((k ** (-4.0d0)) * l) / t)
        end function
        
        public static double code(double t, double l, double k) {
        	return (l + l) * ((Math.pow(k, -4.0) * l) / t);
        }
        
        def code(t, l, k):
        	return (l + l) * ((math.pow(k, -4.0) * l) / t)
        
        function code(t, l, k)
        	return Float64(Float64(l + l) * Float64(Float64((k ^ -4.0) * l) / t))
        end
        
        function tmp = code(t, l, k)
        	tmp = (l + l) * (((k ^ -4.0) * l) / t);
        end
        
        code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] * N[(N[(N[Power[k, -4], $MachinePrecision] * l), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
        
        \left(\ell + \ell\right) \cdot \frac{{k}^{-4} \cdot \ell}{t}
        
        Derivation
        1. Initial program 37.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. Taylor expanded in k around 0

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
          5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
          14. pow-flipN/A

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
          16. metadata-eval68.0%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
        6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
          11. lower-*.f6468.0%

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
        8. Applied rewrites68.0%

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

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

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \frac{{k}^{-4} \cdot \ell}{\color{blue}{t}} \]
          5. lower-*.f6469.0%

            \[\leadsto \left(\ell + \ell\right) \cdot \frac{{k}^{-4} \cdot \ell}{t} \]
        10. Applied rewrites69.0%

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

        Alternative 10: 68.2% accurate, 3.7× speedup?

        \[\left(\ell + \ell\right) \cdot \frac{\ell}{{k}^{4} \cdot t} \]
        (FPCore (t l k)
          :precision binary64
          (* (+ l l) (/ l (* (pow k 4) t))))
        double code(double t, double l, double k) {
        	return (l + l) * (l / (pow(k, 4.0) * t));
        }
        
        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 = (l + l) * (l / ((k ** 4.0d0) * t))
        end function
        
        public static double code(double t, double l, double k) {
        	return (l + l) * (l / (Math.pow(k, 4.0) * t));
        }
        
        def code(t, l, k):
        	return (l + l) * (l / (math.pow(k, 4.0) * t))
        
        function code(t, l, k)
        	return Float64(Float64(l + l) * Float64(l / Float64((k ^ 4.0) * t)))
        end
        
        function tmp = code(t, l, k)
        	tmp = (l + l) * (l / ((k ^ 4.0) * t));
        end
        
        code[t_, l_, k_] := N[(N[(l + l), $MachinePrecision] * N[(l / N[(N[Power[k, 4], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \left(\ell + \ell\right) \cdot \frac{\ell}{{k}^{4} \cdot t}
        
        Derivation
        1. Initial program 37.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. Taylor expanded in k around 0

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

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

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

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

            \[\leadsto 2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot \color{blue}{t}} \]
          5. lower-pow.f6461.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\frac{1}{{k}^{4}}}{t}\right)\right) \]
          14. pow-flipN/A

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{\left(\mathsf{neg}\left(4\right)\right)}}{t}\right)\right) \]
          16. metadata-eval68.0%

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{{k}^{-4}}{t}\right)\right) \]
        6. Applied rewrites68.0%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
          11. lower-*.f6468.0%

            \[\leadsto \left(\ell + \ell\right) \cdot \left(\frac{{k}^{-4}}{t} \cdot \color{blue}{\ell}\right) \]
        8. Applied rewrites68.0%

          \[\leadsto \left(\ell + \ell\right) \cdot \color{blue}{\left(\frac{{k}^{-4}}{t} \cdot \ell\right)} \]
        9. Taylor expanded in t around 0

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

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

            \[\leadsto \left(\ell + \ell\right) \cdot \frac{\ell}{{k}^{4} \cdot t} \]
          3. lower-pow.f6468.2%

            \[\leadsto \left(\ell + \ell\right) \cdot \frac{\ell}{{k}^{4} \cdot t} \]
        11. Applied rewrites68.2%

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

        Alternative 11: 39.6% accurate, 10.3× speedup?

        \[2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2}\right)}\right)\right) \]
        (FPCore (t l k)
          :precision binary64
          (* 2 (* l (* l (/ 1 (* (* (* k k) t) (- 1/2 1/2)))))))
        double code(double t, double l, double k) {
        	return 2.0 * (l * (l * (1.0 / (((k * k) * t) * (0.5 - 0.5)))));
        }
        
        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 * (l * (l * (1.0d0 / (((k * k) * t) * (0.5d0 - 0.5d0)))))
        end function
        
        public static double code(double t, double l, double k) {
        	return 2.0 * (l * (l * (1.0 / (((k * k) * t) * (0.5 - 0.5)))));
        }
        
        def code(t, l, k):
        	return 2.0 * (l * (l * (1.0 / (((k * k) * t) * (0.5 - 0.5)))))
        
        function code(t, l, k)
        	return Float64(2.0 * Float64(l * Float64(l * Float64(1.0 / Float64(Float64(Float64(k * k) * t) * Float64(0.5 - 0.5))))))
        end
        
        function tmp = code(t, l, k)
        	tmp = 2.0 * (l * (l * (1.0 / (((k * k) * t) * (0.5 - 0.5)))));
        end
        
        code[t_, l_, k_] := N[(2 * N[(l * N[(l * N[(1 / N[(N[(N[(k * k), $MachinePrecision] * t), $MachinePrecision] * N[(1/2 - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{1}{\left(\left(k \cdot k\right) \cdot t\right) \cdot \left(\frac{1}{2} - \frac{1}{2}\right)}\right)\right)
        
        Derivation
        1. Initial program 37.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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \left(\ell \cdot \left(\ell \cdot \frac{\cos k}{\left(\left(k \cdot k\right) \cdot t\right) \cdot {\sin \color{blue}{k}}^{2}}\right)\right) \]
          19. lower-*.f6482.1%

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

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

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

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

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

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

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

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

            Reproduce

            ?
            herbie shell --seed 2025285 -o generate:evaluate
            (FPCore (t l k)
              :name "Toniolo and Linder, Equation (10-)"
              :precision binary64
              (/ 2 (* (* (* (/ (pow t 3) (* l l)) (sin k)) (tan k)) (- (+ 1 (pow (/ k t) 2)) 1))))