Toniolo and Linder, Equation (10+)

Percentage Accurate: 53.9% → 88.4%
Time: 8.5s
Alternatives: 26
Speedup: 7.1×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

Alternative 1: 88.4% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 3.2 \cdot 10^{+74}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell} \cdot \mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\ell \cdot \cos k\_m}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 3.19999999999999995e74

    1. Initial program 56.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.9%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6482.7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.19999999999999995e74 < k

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;k\_m \leq 6 \cdot 10^{+85}:\\
\;\;\;\;\frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right)}{\cos k\_m}}\\

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


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

    1. Initial program 56.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites17.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6481.1

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6470.8

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

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

    if 1.9999999999999998e-96 < k < 6.0000000000000001e85

    1. Initial program 58.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites19.5%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

    if 6.0000000000000001e85 < k

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 83.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;k\_m \leq 2.6 \cdot 10^{+74}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right) \cdot t}{\left(\ell \cdot \ell\right) \cdot \cos k\_m}}\\

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000006e-34 < k < 2.6000000000000001e74

    1. Initial program 48.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites18.6%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

    if 2.6000000000000001e74 < k

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 83.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;k\_m \leq 3 \cdot 10^{+76}:\\
\;\;\;\;\frac{2}{\frac{\mathsf{fma}\left({\left(\sin k\_m \cdot t\right)}^{2}, 2, {\left(\sin k\_m \cdot k\_m\right)}^{2}\right) \cdot t}{\left(\cos k\_m \cdot \ell\right) \cdot \ell}}\\

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15000000000000006e-34 < k < 2.9999999999999998e76

    1. Initial program 48.7%

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

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

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

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

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

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

    if 2.9999999999999998e76 < k

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 82.0% accurate, 1.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;k\_m \leq 5.2 \cdot 10^{-35}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{elif}\;k\_m \leq 5.4 \cdot 10^{+80}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{{\left(\frac{\ell}{k\_m}\right)}^{2}}{{\sin k\_m}^{2}} \cdot \frac{\cos k\_m}{t}\right) \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= k_m 5.2e-35)
     (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0)))
     (if (<= k_m 5.4e+80)
       (/ 2.0 (* t_1 (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
       (*
        (* (/ (pow (/ l k_m) 2.0) (pow (sin k_m) 2.0)) (/ (cos k_m) t))
        2.0)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 5.4e+80) {
		tmp = 2.0 / (t_1 * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
	} else {
		tmp = ((pow((l / k_m), 2.0) / pow(sin(k_m), 2.0)) * (cos(k_m) / t)) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (t / l) / l
    if (k_m <= 5.2d-35) then
        tmp = 2.0d0 / (t_1 * (((k_m * t) ** 2.0d0) * 2.0d0))
    else if (k_m <= 5.4d+80) then
        tmp = 2.0d0 / (t_1 * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
    else
        tmp = ((((l / k_m) ** 2.0d0) / (sin(k_m) ** 2.0d0)) * (cos(k_m) / t)) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (Math.pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 5.4e+80) {
		tmp = 2.0 / (t_1 * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
	} else {
		tmp = ((Math.pow((l / k_m), 2.0) / Math.pow(Math.sin(k_m), 2.0)) * (Math.cos(k_m) / t)) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = (t / l) / l
	tmp = 0
	if k_m <= 5.2e-35:
		tmp = 2.0 / (t_1 * (math.pow((k_m * t), 2.0) * 2.0))
	elif k_m <= 5.4e+80:
		tmp = 2.0 / (t_1 * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m)))
	else:
		tmp = ((math.pow((l / k_m), 2.0) / math.pow(math.sin(k_m), 2.0)) * (math.cos(k_m) / t)) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (k_m <= 5.2e-35)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	elseif (k_m <= 5.4e+80)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m))));
	else
		tmp = Float64(Float64(Float64((Float64(l / k_m) ^ 2.0) / (sin(k_m) ^ 2.0)) * Float64(cos(k_m) / t)) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = (t / l) / l;
	tmp = 0.0;
	if (k_m <= 5.2e-35)
		tmp = 2.0 / (t_1 * (((k_m * t) ^ 2.0) * 2.0));
	elseif (k_m <= 5.4e+80)
		tmp = 2.0 / (t_1 * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m)));
	else
		tmp = ((((l / k_m) ^ 2.0) / (sin(k_m) ^ 2.0)) * (cos(k_m) / t)) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 5.2e-35], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 5.4e+80], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[N[(l / k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

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

\mathbf{elif}\;k\_m \leq 5.4 \cdot 10^{+80}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000009e-35 < k < 5.39999999999999966e80

    1. Initial program 53.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites21.8%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6488.7

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}} \]
      5. lift-pow.f6473.9

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

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

    if 5.39999999999999966e80 < k

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 82.1% accurate, 1.2× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;k\_m \leq 5.2 \cdot 10^{-35}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{elif}\;k\_m \leq 2.5 \cdot 10^{+74}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \left(\frac{\frac{\cos k\_m}{t}}{{\sin k\_m}^{2}} \cdot 2\right)\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= k_m 5.2e-35)
     (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0)))
     (if (<= k_m 2.5e+74)
       (/ 2.0 (* t_1 (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
       (*
        (* (/ l k_m) (/ l k_m))
        (* (/ (/ (cos k_m) t) (pow (sin k_m) 2.0)) 2.0))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 2.5e+74) {
		tmp = 2.0 / (t_1 * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
	} else {
		tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / pow(sin(k_m), 2.0)) * 2.0);
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (t / l) / l
    if (k_m <= 5.2d-35) then
        tmp = 2.0d0 / (t_1 * (((k_m * t) ** 2.0d0) * 2.0d0))
    else if (k_m <= 2.5d+74) then
        tmp = 2.0d0 / (t_1 * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
    else
        tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (sin(k_m) ** 2.0d0)) * 2.0d0)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (Math.pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 2.5e+74) {
		tmp = 2.0 / (t_1 * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
	} else {
		tmp = ((l / k_m) * (l / k_m)) * (((Math.cos(k_m) / t) / Math.pow(Math.sin(k_m), 2.0)) * 2.0);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = (t / l) / l
	tmp = 0
	if k_m <= 5.2e-35:
		tmp = 2.0 / (t_1 * (math.pow((k_m * t), 2.0) * 2.0))
	elif k_m <= 2.5e+74:
		tmp = 2.0 / (t_1 * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m)))
	else:
		tmp = ((l / k_m) * (l / k_m)) * (((math.cos(k_m) / t) / math.pow(math.sin(k_m), 2.0)) * 2.0)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (k_m <= 5.2e-35)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	elseif (k_m <= 2.5e+74)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m))));
	else
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(Float64(Float64(cos(k_m) / t) / (sin(k_m) ^ 2.0)) * 2.0));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = (t / l) / l;
	tmp = 0.0;
	if (k_m <= 5.2e-35)
		tmp = 2.0 / (t_1 * (((k_m * t) ^ 2.0) * 2.0));
	elseif (k_m <= 2.5e+74)
		tmp = 2.0 / (t_1 * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m)));
	else
		tmp = ((l / k_m) * (l / k_m)) * (((cos(k_m) / t) / (sin(k_m) ^ 2.0)) * 2.0);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 5.2e-35], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 2.5e+74], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(N[Cos[k$95$m], $MachinePrecision] / t), $MachinePrecision] / N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

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

\mathbf{elif}\;k\_m \leq 2.5 \cdot 10^{+74}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000009e-35 < k < 2.49999999999999982e74

    1. Initial program 48.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites18.6%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.49999999999999982e74 < k

    1. Initial program 50.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 82.0% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;k\_m \leq 5.2 \cdot 10^{-35}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{elif}\;k\_m \leq 4 \cdot 10^{+79}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{\cos k\_m}{{\sin k\_m}^{2} \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= k_m 5.2e-35)
     (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0)))
     (if (<= k_m 4e+79)
       (/ 2.0 (* t_1 (/ (pow (* (sin k_m) k_m) 2.0) (cos k_m))))
       (*
        (* (* (/ l k_m) (/ l k_m)) (/ (cos k_m) (* (pow (sin k_m) 2.0) t)))
        2.0)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 4e+79) {
		tmp = 2.0 / (t_1 * (pow((sin(k_m) * k_m), 2.0) / cos(k_m)));
	} else {
		tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / (pow(sin(k_m), 2.0) * t))) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (t / l) / l
    if (k_m <= 5.2d-35) then
        tmp = 2.0d0 / (t_1 * (((k_m * t) ** 2.0d0) * 2.0d0))
    else if (k_m <= 4d+79) then
        tmp = 2.0d0 / (t_1 * (((sin(k_m) * k_m) ** 2.0d0) / cos(k_m)))
    else
        tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ** 2.0d0) * t))) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (k_m <= 5.2e-35) {
		tmp = 2.0 / (t_1 * (Math.pow((k_m * t), 2.0) * 2.0));
	} else if (k_m <= 4e+79) {
		tmp = 2.0 / (t_1 * (Math.pow((Math.sin(k_m) * k_m), 2.0) / Math.cos(k_m)));
	} else {
		tmp = (((l / k_m) * (l / k_m)) * (Math.cos(k_m) / (Math.pow(Math.sin(k_m), 2.0) * t))) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = (t / l) / l
	tmp = 0
	if k_m <= 5.2e-35:
		tmp = 2.0 / (t_1 * (math.pow((k_m * t), 2.0) * 2.0))
	elif k_m <= 4e+79:
		tmp = 2.0 / (t_1 * (math.pow((math.sin(k_m) * k_m), 2.0) / math.cos(k_m)))
	else:
		tmp = (((l / k_m) * (l / k_m)) * (math.cos(k_m) / (math.pow(math.sin(k_m), 2.0) * t))) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (k_m <= 5.2e-35)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	elseif (k_m <= 4e+79)
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(sin(k_m) * k_m) ^ 2.0) / cos(k_m))));
	else
		tmp = Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(cos(k_m) / Float64((sin(k_m) ^ 2.0) * t))) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = (t / l) / l;
	tmp = 0.0;
	if (k_m <= 5.2e-35)
		tmp = 2.0 / (t_1 * (((k_m * t) ^ 2.0) * 2.0));
	elseif (k_m <= 4e+79)
		tmp = 2.0 / (t_1 * (((sin(k_m) * k_m) ^ 2.0) / cos(k_m)));
	else
		tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ^ 2.0) * t))) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[k$95$m, 5.2e-35], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k$95$m, 4e+79], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(N[Sin[k$95$m], $MachinePrecision] * k$95$m), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

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

\mathbf{elif}\;k\_m \leq 4 \cdot 10^{+79}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{{\left(\sin k\_m \cdot k\_m\right)}^{2}}{\cos k\_m}}\\

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000009e-35 < k < 3.99999999999999987e79

    1. Initial program 53.4%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites21.8%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6488.7

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{\left(\sin k \cdot k\right)}^{2}}{\cos k}} \]
      5. lift-pow.f6473.9

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

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

    if 3.99999999999999987e79 < k

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      7. lower-/.f6492.0

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

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

Alternative 8: 81.3% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 2.5 \cdot 10^{-34}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \frac{\cos k\_m}{{\sin k\_m}^{2} \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 2.5e-34)
   (/ 2.0 (* (/ (/ t l) l) (* (pow (* k_m t) 2.0) 2.0)))
   (*
    (* (* (/ l k_m) (/ l k_m)) (/ (cos k_m) (* (pow (sin k_m) 2.0) t)))
    2.0)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.5e-34) {
		tmp = 2.0 / (((t / l) / l) * (pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / (pow(sin(k_m), 2.0) * t))) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 2.5d-34) then
        tmp = 2.0d0 / (((t / l) / l) * (((k_m * t) ** 2.0d0) * 2.0d0))
    else
        tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ** 2.0d0) * t))) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 2.5e-34) {
		tmp = 2.0 / (((t / l) / l) * (Math.pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l / k_m) * (l / k_m)) * (Math.cos(k_m) / (Math.pow(Math.sin(k_m), 2.0) * t))) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 2.5e-34:
		tmp = 2.0 / (((t / l) / l) * (math.pow((k_m * t), 2.0) * 2.0))
	else:
		tmp = (((l / k_m) * (l / k_m)) * (math.cos(k_m) / (math.pow(math.sin(k_m), 2.0) * t))) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 2.5e-34)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	else
		tmp = Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * Float64(cos(k_m) / Float64((sin(k_m) ^ 2.0) * t))) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 2.5e-34)
		tmp = 2.0 / (((t / l) / l) * (((k_m * t) ^ 2.0) * 2.0));
	else
		tmp = (((l / k_m) * (l / k_m)) * (cos(k_m) / ((sin(k_m) ^ 2.0) * t))) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 2.5e-34], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-34 < k

    1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 81.3% accurate, 1.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot \cos k\_m}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right) \cdot t} \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.6e-15)
   (/ 2.0 (* (/ (/ t l) l) (* (pow (* k_m t) 2.0) 2.0)))
   (*
    (/
     (* (* (/ l k_m) (/ l k_m)) (cos k_m))
     (* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) t))
    2.0)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * t)) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.6d-15) then
        tmp = 2.0d0 / (((t / l) / l) * (((k_m * t) ** 2.0d0) * 2.0d0))
    else
        tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k_m)))) * t)) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (Math.pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = ((((l / k_m) * (l / k_m)) * Math.cos(k_m)) / ((0.5 - (0.5 * Math.cos((2.0 * k_m)))) * t)) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.6e-15:
		tmp = 2.0 / (((t / l) / l) * (math.pow((k_m * t), 2.0) * 2.0))
	else:
		tmp = ((((l / k_m) * (l / k_m)) * math.cos(k_m)) / ((0.5 - (0.5 * math.cos((2.0 * k_m)))) * t)) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.6e-15)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * cos(k_m)) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) * t)) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.6e-15)
		tmp = 2.0 / (((t / l) / l) * (((k_m * t) ^ 2.0) * 2.0));
	else
		tmp = ((((l / k_m) * (l / k_m)) * cos(k_m)) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * t)) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.6e-15], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.6%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e-15 < k

    1. Initial program 49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 72.6% accurate, 1.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\frac{\cos k\_m}{0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)}}{t}\right) \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.6e-15)
   (/ 2.0 (* (/ (/ t l) l) (* (pow (* k_m t) 2.0) 2.0)))
   (*
    (*
     (/ (* l l) (* k_m k_m))
     (/ (/ (cos k_m) (- 0.5 (* 0.5 (cos (* 2.0 k_m))))) t))
    2.0)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l * l) / (k_m * k_m)) * ((cos(k_m) / (0.5 - (0.5 * cos((2.0 * k_m))))) / t)) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.6d-15) then
        tmp = 2.0d0 / (((t / l) / l) * (((k_m * t) ** 2.0d0) * 2.0d0))
    else
        tmp = (((l * l) / (k_m * k_m)) * ((cos(k_m) / (0.5d0 - (0.5d0 * cos((2.0d0 * k_m))))) / t)) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (Math.pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l * l) / (k_m * k_m)) * ((Math.cos(k_m) / (0.5 - (0.5 * Math.cos((2.0 * k_m))))) / t)) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.6e-15:
		tmp = 2.0 / (((t / l) / l) * (math.pow((k_m * t), 2.0) * 2.0))
	else:
		tmp = (((l * l) / (k_m * k_m)) * ((math.cos(k_m) / (0.5 - (0.5 * math.cos((2.0 * k_m))))) / t)) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.6e-15)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	else
		tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(Float64(cos(k_m) / Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m))))) / t)) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.6e-15)
		tmp = 2.0 / (((t / l) / l) * (((k_m * t) ^ 2.0) * 2.0));
	else
		tmp = (((l * l) / (k_m * k_m)) * ((cos(k_m) / (0.5 - (0.5 * cos((2.0 * k_m))))) / t)) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.6e-15], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Cos[k$95$m], $MachinePrecision] / N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.6%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e-15 < k

    1. Initial program 49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\frac{\cos k}{{\sin k}^{2}}}{t}\right) \cdot 2 \]
      11. lift-pow.f6467.2

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 72.6% accurate, 1.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.6 \cdot 10^{-15}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(0.5 - 0.5 \cdot \cos \left(2 \cdot k\_m\right)\right) \cdot t}\right) \cdot 2\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.6e-15)
   (/ 2.0 (* (/ (/ t l) l) (* (pow (* k_m t) 2.0) 2.0)))
   (*
    (*
     (/ (* l l) (* k_m k_m))
     (/ (cos k_m) (* (- 0.5 (* 0.5 (cos (* 2.0 k_m)))) t)))
    2.0)))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * t))) * 2.0;
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.6d-15) then
        tmp = 2.0d0 / (((t / l) / l) * (((k_m * t) ** 2.0d0) * 2.0d0))
    else
        tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5d0 - (0.5d0 * cos((2.0d0 * k_m)))) * t))) * 2.0d0
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.6e-15) {
		tmp = 2.0 / (((t / l) / l) * (Math.pow((k_m * t), 2.0) * 2.0));
	} else {
		tmp = (((l * l) / (k_m * k_m)) * (Math.cos(k_m) / ((0.5 - (0.5 * Math.cos((2.0 * k_m)))) * t))) * 2.0;
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.6e-15:
		tmp = 2.0 / (((t / l) / l) * (math.pow((k_m * t), 2.0) * 2.0))
	else:
		tmp = (((l * l) / (k_m * k_m)) * (math.cos(k_m) / ((0.5 - (0.5 * math.cos((2.0 * k_m)))) * t))) * 2.0
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.6e-15)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	else
		tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(cos(k_m) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * k_m)))) * t))) * 2.0);
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.6e-15)
		tmp = 2.0 / (((t / l) / l) * (((k_m * t) ^ 2.0) * 2.0));
	else
		tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((0.5 - (0.5 * cos((2.0 * k_m)))) * t))) * 2.0;
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.6e-15], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * k$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

    1. Initial program 57.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.6%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6e-15 < k

    1. Initial program 49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 60.2% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.006349206349206349, t \cdot t, 0.044444444444444446\right), k\_m \cdot k\_m, 0.08888888888888889 \cdot \left(t \cdot t\right)\right) - 0.3333333333333333, k\_m \cdot k\_m, -0.6666666666666666 \cdot \left(t \cdot t\right)\right) + 1, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m}}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 8.6e-116)
     (/
      2.0
      (*
       t_1
       (/
        (*
         (fma
          (+
           (fma
            (-
             (fma
              (fma -0.006349206349206349 (* t t) 0.044444444444444446)
              (* k_m k_m)
              (* 0.08888888888888889 (* t t)))
             0.3333333333333333)
            (* k_m k_m)
            (* -0.6666666666666666 (* t t)))
           1.0)
          (* k_m k_m)
          (* (* t t) 2.0))
         (* k_m k_m))
        (cos k_m))))
     (if (<= t 1.16e+92)
       (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
       (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 8.6e-116) {
		tmp = 2.0 / (t_1 * ((fma((fma((fma(fma(-0.006349206349206349, (t * t), 0.044444444444444446), (k_m * k_m), (0.08888888888888889 * (t * t))) - 0.3333333333333333), (k_m * k_m), (-0.6666666666666666 * (t * t))) + 1.0), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)) / cos(k_m)));
	} else if (t <= 1.16e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 8.6e-116)
		tmp = Float64(2.0 / Float64(t_1 * Float64(Float64(fma(Float64(fma(Float64(fma(fma(-0.006349206349206349, Float64(t * t), 0.044444444444444446), Float64(k_m * k_m), Float64(0.08888888888888889 * Float64(t * t))) - 0.3333333333333333), Float64(k_m * k_m), Float64(-0.6666666666666666 * Float64(t * t))) + 1.0), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m)) / cos(k_m))));
	elseif (t <= 1.16e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 8.6e-116], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(N[(N[(N[(N[(-0.006349206349206349 * N[(t * t), $MachinePrecision] + 0.044444444444444446), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(0.08888888888888889 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(-0.6666666666666666 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.006349206349206349, t \cdot t, 0.044444444444444446\right), k\_m \cdot k\_m, 0.08888888888888889 \cdot \left(t \cdot t\right)\right) - 0.3333333333333333, k\_m \cdot k\_m, -0.6666666666666666 \cdot \left(t \cdot t\right)\right) + 1, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)}{\cos k\_m}}\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5999999999999994e-116

    1. Initial program 49.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites12.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.3

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

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

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{{k}^{2} \cdot \left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(1 + \left(\frac{-2}{3} \cdot {t}^{2} + {k}^{2} \cdot \left(\left(\frac{4}{45} \cdot {t}^{2} + {k}^{2} \cdot \left(\frac{2}{45} + \frac{-2}{315} \cdot {t}^{2}\right)\right) - \frac{1}{3}\right)\right)\right)\right)}{\cos \color{blue}{k}}} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(1 + \left(\frac{-2}{3} \cdot {t}^{2} + {k}^{2} \cdot \left(\left(\frac{4}{45} \cdot {t}^{2} + {k}^{2} \cdot \left(\frac{2}{45} + \frac{-2}{315} \cdot {t}^{2}\right)\right) - \frac{1}{3}\right)\right)\right)\right) \cdot {k}^{2}}{\cos k}} \]
    11. Applied rewrites53.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.006349206349206349, t \cdot t, 0.044444444444444446\right), k \cdot k, 0.08888888888888889 \cdot \left(t \cdot t\right)\right) - 0.3333333333333333, k \cdot k, -0.6666666666666666 \cdot \left(t \cdot t\right)\right) + 1, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)}{\cos \color{blue}{k}}} \]

    if 8.5999999999999994e-116 < t < 1.16000000000000006e92

    1. Initial program 69.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6450.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6468.4

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites68.4%

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

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites0.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6493.7

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

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6491.9

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

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

Alternative 13: 59.8% accurate, 2.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right)\\ t_2 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \left(\mathsf{fma}\left(\left(t\_1 + \left(\left(0.08888888888888889 \cdot \left(t \cdot t\right) - 0.3333333333333333\right) - \mathsf{fma}\left(t\_1 + t \cdot t, -0.5, 0.08333333333333333 \cdot \left(t \cdot t\right)\right)\right) \cdot \left(k\_m \cdot k\_m\right)\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t}\right) \cdot 2\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_2 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (fma -0.6666666666666666 (* t t) 1.0)) (t_2 (/ (/ t l) l)))
   (if (<= t 5.2e-244)
     (/
      2.0
      (*
       t_2
       (*
        (fma
         (+
          (+
           t_1
           (*
            (-
             (- (* 0.08888888888888889 (* t t)) 0.3333333333333333)
             (fma (+ t_1 (* t t)) -0.5 (* 0.08333333333333333 (* t t))))
            (* k_m k_m)))
          (* t t))
         (* k_m k_m)
         (* (* t t) 2.0))
        (* k_m k_m))))
     (if (<= t 3.5e-114)
       (* (* (/ (* l l) (* k_m k_m)) (/ (cos k_m) (* (* k_m k_m) t))) 2.0)
       (if (<= t 1.16e+92)
         (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
         (/ 2.0 (* t_2 (* (pow (* k_m t) 2.0) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = fma(-0.6666666666666666, (t * t), 1.0);
	double t_2 = (t / l) / l;
	double tmp;
	if (t <= 5.2e-244) {
		tmp = 2.0 / (t_2 * (fma(((t_1 + ((((0.08888888888888889 * (t * t)) - 0.3333333333333333) - fma((t_1 + (t * t)), -0.5, (0.08333333333333333 * (t * t)))) * (k_m * k_m))) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 3.5e-114) {
		tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((k_m * k_m) * t))) * 2.0;
	} else if (t <= 1.16e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = 2.0 / (t_2 * (pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = fma(-0.6666666666666666, Float64(t * t), 1.0)
	t_2 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 5.2e-244)
		tmp = Float64(2.0 / Float64(t_2 * Float64(fma(Float64(Float64(t_1 + Float64(Float64(Float64(Float64(0.08888888888888889 * Float64(t * t)) - 0.3333333333333333) - fma(Float64(t_1 + Float64(t * t)), -0.5, Float64(0.08333333333333333 * Float64(t * t)))) * Float64(k_m * k_m))) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 3.5e-114)
		tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(cos(k_m) / Float64(Float64(k_m * k_m) * t))) * 2.0);
	elseif (t <= 1.16e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(t_2 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 5.2e-244], N[(2.0 / N[(t$95$2 * N[(N[(N[(N[(t$95$1 + N[(N[(N[(N[(0.08888888888888889 * N[(t * t), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] - N[(N[(t$95$1 + N[(t * t), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(0.08333333333333333 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-114], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$2 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right)\\
t_2 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\
\;\;\;\;\frac{2}{t\_2 \cdot \left(\mathsf{fma}\left(\left(t\_1 + \left(\left(0.08888888888888889 \cdot \left(t \cdot t\right) - 0.3333333333333333\right) - \mathsf{fma}\left(t\_1 + t \cdot t, -0.5, 0.08333333333333333 \cdot \left(t \cdot t\right)\right)\right) \cdot \left(k\_m \cdot k\_m\right)\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\
\;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t}\right) \cdot 2\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 5.2000000000000003e-244

    1. Initial program 52.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites14.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6479.7

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

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

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \left(\frac{-2}{3} \cdot {t}^{2} + {k}^{2} \cdot \left(\frac{4}{45} \cdot {t}^{2} - \left(\frac{1}{3} + \left(\frac{-1}{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right) + \frac{1}{12} \cdot {t}^{2}\right)\right)\right)\right)\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Applied rewrites48.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + \left(\left(0.08888888888888889 \cdot \left(t \cdot t\right) - 0.3333333333333333\right) - \mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, -0.5, 0.08333333333333333 \cdot \left(t \cdot t\right)\right)\right) \cdot \left(k \cdot k\right)\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 5.2000000000000003e-244 < t < 3.5e-114

    1. Initial program 28.2%

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

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

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

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

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

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

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

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

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

    if 3.5e-114 < t < 1.16000000000000006e92

    1. Initial program 70.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6451.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6469.6

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites69.6%

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

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites0.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6493.7

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

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

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

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

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

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      4. lower-pow.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6491.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
    11. Applied rewrites91.9%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot \color{blue}{2}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + \left(\left(0.08888888888888889 \cdot \left(t \cdot t\right) - 0.3333333333333333\right) - \mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, -0.5, 0.08333333333333333 \cdot \left(t \cdot t\right)\right)\right) \cdot \left(k \cdot k\right)\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 59.9% accurate, 2.7× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t}\right) \cdot 2\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 5.2e-244)
     (/
      2.0
      (*
       t_1
       (*
        (fma
         (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
         (* k_m k_m)
         (* (* t t) 2.0))
        (* k_m k_m))))
     (if (<= t 3.5e-114)
       (* (* (/ (* l l) (* k_m k_m)) (/ (cos k_m) (* (* k_m k_m) t))) 2.0)
       (if (<= t 1.16e+92)
         (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
         (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 5.2e-244) {
		tmp = 2.0 / (t_1 * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 3.5e-114) {
		tmp = (((l * l) / (k_m * k_m)) * (cos(k_m) / ((k_m * k_m) * t))) * 2.0;
	} else if (t <= 1.16e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 5.2e-244)
		tmp = Float64(2.0 / Float64(t_1 * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 3.5e-114)
		tmp = Float64(Float64(Float64(Float64(l * l) / Float64(k_m * k_m)) * Float64(cos(k_m) / Float64(Float64(k_m * k_m) * t))) * 2.0);
	elseif (t <= 1.16e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 5.2e-244], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.5e-114], N[(N[(N[(N[(l * l), $MachinePrecision] / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k$95$m], $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\
\;\;\;\;\left(\frac{\ell \cdot \ell}{k\_m \cdot k\_m} \cdot \frac{\cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t}\right) \cdot 2\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < 5.2000000000000003e-244

    1. Initial program 52.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites14.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites69.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6479.7

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites79.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites48.4%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 5.2000000000000003e-244 < t < 3.5e-114

    1. Initial program 28.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
    5. Applied rewrites80.7%

      \[\leadsto \color{blue}{\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
    6. Taylor expanded in k around 0

      \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{k}^{2} \cdot t}\right) \cdot 2 \]
    7. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
      2. lift-*.f6480.7

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]
    8. Applied rewrites80.7%

      \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2 \]

    if 3.5e-114 < t < 1.16000000000000006e92

    1. Initial program 70.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6451.6

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites51.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      3. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{{t}^{3}}} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}}}{{t}^{3}} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{\color{blue}{{t}^{3}}} \]
      12. times-fracN/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6469.6

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites69.6%

      \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\color{blue}{{t}^{3}}} \]

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites0.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites82.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6493.7

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites93.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left({k}^{2} \cdot {t}^{2}\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      3. pow-prod-downN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      4. lower-pow.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6491.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
    11. Applied rewrites91.9%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot \color{blue}{2}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.2 \cdot 10^{-244}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 3.5 \cdot 10^{-114}:\\ \;\;\;\;\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{\left(k \cdot k\right) \cdot t}\right) \cdot 2\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 65.8% accurate, 2.8× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\\ \mathbf{if}\;t \leq 6.8 \cdot 10^{-99}:\\ \;\;\;\;\frac{t\_1 \cdot \cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{t\_1}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (* (/ l k_m) (/ l k_m))))
   (if (<= t 6.8e-99)
     (* (/ (* t_1 (cos k_m)) (* (* k_m k_m) t)) 2.0)
     (if (<= t 1.16e+92)
       (/ t_1 (pow t 3.0))
       (/ 2.0 (* (/ (/ t l) l) (* (pow (* k_m t) 2.0) 2.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (l / k_m) * (l / k_m);
	double tmp;
	if (t <= 6.8e-99) {
		tmp = ((t_1 * cos(k_m)) / ((k_m * k_m) * t)) * 2.0;
	} else if (t <= 1.16e+92) {
		tmp = t_1 / pow(t, 3.0);
	} else {
		tmp = 2.0 / (((t / l) / l) * (pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (l / k_m) * (l / k_m)
    if (t <= 6.8d-99) then
        tmp = ((t_1 * cos(k_m)) / ((k_m * k_m) * t)) * 2.0d0
    else if (t <= 1.16d+92) then
        tmp = t_1 / (t ** 3.0d0)
    else
        tmp = 2.0d0 / (((t / l) / l) * (((k_m * t) ** 2.0d0) * 2.0d0))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = (l / k_m) * (l / k_m);
	double tmp;
	if (t <= 6.8e-99) {
		tmp = ((t_1 * Math.cos(k_m)) / ((k_m * k_m) * t)) * 2.0;
	} else if (t <= 1.16e+92) {
		tmp = t_1 / Math.pow(t, 3.0);
	} else {
		tmp = 2.0 / (((t / l) / l) * (Math.pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = (l / k_m) * (l / k_m)
	tmp = 0
	if t <= 6.8e-99:
		tmp = ((t_1 * math.cos(k_m)) / ((k_m * k_m) * t)) * 2.0
	elif t <= 1.16e+92:
		tmp = t_1 / math.pow(t, 3.0)
	else:
		tmp = 2.0 / (((t / l) / l) * (math.pow((k_m * t), 2.0) * 2.0))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(l / k_m) * Float64(l / k_m))
	tmp = 0.0
	if (t <= 6.8e-99)
		tmp = Float64(Float64(Float64(t_1 * cos(k_m)) / Float64(Float64(k_m * k_m) * t)) * 2.0);
	elseif (t <= 1.16e+92)
		tmp = Float64(t_1 / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = (l / k_m) * (l / k_m);
	tmp = 0.0;
	if (t <= 6.8e-99)
		tmp = ((t_1 * cos(k_m)) / ((k_m * k_m) * t)) * 2.0;
	elseif (t <= 1.16e+92)
		tmp = t_1 / (t ^ 3.0);
	else
		tmp = 2.0 / (((t / l) / l) * (((k_m * t) ^ 2.0) * 2.0));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 6.8e-99], N[(N[(N[(t$95$1 * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(t$95$1 / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\\
\mathbf{if}\;t \leq 6.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{t\_1 \cdot \cos k\_m}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{t\_1}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 6.80000000000000014e-99

    1. Initial program 50.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
    5. Applied rewrites63.8%

      \[\leadsto \color{blue}{\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      4. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      5. lift-/.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      6. lift-cos.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      7. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      8. lift-pow.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      9. lift-sin.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      10. associate-*r/N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      13. times-fracN/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      17. lift-cos.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      18. lift-sin.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      19. lift-pow.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
    7. Applied rewrites73.6%

      \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{k}^{2} \cdot t} \cdot 2 \]
    9. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
      2. lift-*.f6458.6

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
    10. Applied rewrites58.6%

      \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{\left(k \cdot k\right) \cdot t} \cdot 2 \]

    if 6.80000000000000014e-99 < t < 1.16000000000000006e92

    1. Initial program 68.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6449.4

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites49.4%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      3. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{{t}^{3}}} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}}}{{t}^{3}} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{\color{blue}{{t}^{3}}} \]
      12. times-fracN/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6467.7

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites67.7%

      \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\color{blue}{{t}^{3}}} \]

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites0.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites82.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6493.7

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites93.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left({k}^{2} \cdot {t}^{2}\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      3. pow-prod-downN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      4. lower-pow.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6491.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
    11. Applied rewrites91.9%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot \color{blue}{2}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 16: 60.0% accurate, 2.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\frac{t}{\ell}}{\ell}\\ \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ (/ t l) l)))
   (if (<= t 8.6e-116)
     (/
      2.0
      (*
       t_1
       (*
        (fma
         (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
         (* k_m k_m)
         (* (* t t) 2.0))
        (* k_m k_m))))
     (if (<= t 1.16e+92)
       (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
       (/ 2.0 (* t_1 (* (pow (* k_m t) 2.0) 2.0)))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = (t / l) / l;
	double tmp;
	if (t <= 8.6e-116) {
		tmp = 2.0 / (t_1 * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 1.16e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = 2.0 / (t_1 * (pow((k_m * t), 2.0) * 2.0));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(Float64(t / l) / l)
	tmp = 0.0
	if (t <= 8.6e-116)
		tmp = Float64(2.0 / Float64(t_1 * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 1.16e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(t_1 * Float64((Float64(k_m * t) ^ 2.0) * 2.0)));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[t, 8.6e-116], N[(2.0 / N[(t$95$1 * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t$95$1 * N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \frac{\frac{t}{\ell}}{\ell}\\
\mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{t\_1 \cdot \left({\left(k\_m \cdot t\right)}^{2} \cdot 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5999999999999994e-116

    1. Initial program 49.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites12.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites80.3%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites52.0%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 8.5999999999999994e-116 < t < 1.16000000000000006e92

    1. Initial program 69.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6450.6

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites50.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      3. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{{t}^{3}}} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}}}{{t}^{3}} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{\color{blue}{{t}^{3}}} \]
      12. times-fracN/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6468.4

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites68.4%

      \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\color{blue}{{t}^{3}}} \]

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites0.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites82.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6493.7

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites93.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(2 \cdot \color{blue}{\left({k}^{2} \cdot {t}^{2}\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left({k}^{2} \cdot {t}^{2}\right) \cdot 2\right)} \]
      3. pow-prod-downN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      4. lower-pow.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
      5. lower-*.f6491.9

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)} \]
    11. Applied rewrites91.9%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot \color{blue}{2}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({\left(k \cdot t\right)}^{2} \cdot 2\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 58.3% accurate, 3.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 8.6e-116)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (if (<= t 1.2e+92)
     (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
     (/ 2.0 (* (* (/ (pow (* k_m t) 2.0) (* l l)) 2.0) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 8.6e-116) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 1.2e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = 2.0 / (((pow((k_m * t), 2.0) / (l * l)) * 2.0) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 8.6e-116)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 1.2e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64((Float64(k_m * t) ^ 2.0) / Float64(l * l)) * 2.0) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 8.6e-116], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.2e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\frac{{\left(k\_m \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5999999999999994e-116

    1. Initial program 49.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites12.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites80.3%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites52.0%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 8.5999999999999994e-116 < t < 1.20000000000000002e92

    1. Initial program 69.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6450.6

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites50.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      3. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{{t}^{3}}} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}}}{{t}^{3}} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{\color{blue}{{t}^{3}}} \]
      12. times-fracN/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6468.4

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites68.4%

      \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\color{blue}{{t}^{3}}} \]

    if 1.20000000000000002e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right) \cdot \color{blue}{t}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right) \cdot \color{blue}{t}} \]
    5. Applied rewrites80.8%

      \[\leadsto \frac{2}{\color{blue}{\frac{\mathsf{fma}\left(2, {\left(\sin k \cdot t\right)}^{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k \cdot \left(\ell \cdot \ell\right)} \cdot t}} \]
    6. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\left(2 \cdot \frac{{k}^{2} \cdot {t}^{2}}{{\ell}^{2}}\right) \cdot t} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {t}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {t}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\frac{{k}^{2} \cdot {t}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      4. pow-prod-downN/A

        \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      5. lower-pow.f64N/A

        \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{{\ell}^{2}} \cdot 2\right) \cdot t} \]
      7. pow2N/A

        \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t} \]
      8. lift-*.f6480.8

        \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t} \]
    8. Applied rewrites80.8%

      \[\leadsto \frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{\left(k \cdot t\right)}^{2}}{\ell \cdot \ell} \cdot 2\right) \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 57.9% accurate, 3.0× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 8.6e-116)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (if (<= t 1.16e+92)
     (/ (* (/ l k_m) (/ l k_m)) (pow t 3.0))
     (/ (* l l) (* (pow (* k_m t) 2.0) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 8.6e-116) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 1.16e+92) {
		tmp = ((l / k_m) * (l / k_m)) / pow(t, 3.0);
	} else {
		tmp = (l * l) / (pow((k_m * t), 2.0) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 8.6e-116)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 1.16e+92)
		tmp = Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) / (t ^ 3.0));
	else
		tmp = Float64(Float64(l * l) / Float64((Float64(k_m * t) ^ 2.0) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 8.6e-116], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.16e+92], N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\
\;\;\;\;\frac{\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 8.5999999999999994e-116

    1. Initial program 49.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites12.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.3

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites80.3%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites52.0%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 8.5999999999999994e-116 < t < 1.16000000000000006e92

    1. Initial program 69.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6450.6

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites50.6%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      3. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(k \cdot k\right)} \cdot {t}^{3}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. pow2N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{\color{blue}{3}}} \]
      8. associate-/r*N/A

        \[\leadsto \frac{\frac{{\ell}^{2}}{{k}^{2}}}{\color{blue}{{t}^{3}}} \]
      9. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{{k}^{2}}}{{t}^{3}} \]
      10. pow2N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{{t}^{3}} \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k}}{\color{blue}{{t}^{3}}} \]
      12. times-fracN/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{\color{blue}{t}}^{3}} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}} \]
      16. lift-pow.f6468.4

        \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites68.4%

      \[\leadsto \frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{\color{blue}{{t}^{3}}} \]

    if 1.16000000000000006e92 < t

    1. Initial program 59.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6447.4

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites47.4%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      5. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. lift-*.f6447.4

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    7. Applied rewrites47.4%

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\left(t \cdot t\right) \cdot t\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left({t}^{2} \cdot t\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      9. pow-prod-downN/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      11. lower-*.f6482.5

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
    9. Applied rewrites82.5%

      \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot \color{blue}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification61.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 8.6 \cdot 10^{-116}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 1.16 \cdot 10^{+92}:\\ \;\;\;\;\frac{\frac{\ell}{k} \cdot \frac{\ell}{k}}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 56.9% accurate, 3.2× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 1.22 \cdot 10^{-57}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{\ell}{k\_m \cdot k\_m} \cdot \frac{\ell}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 1.22e-57)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (if (<= t 2.5e+20)
     (* (/ l (* k_m k_m)) (/ l (pow t 3.0)))
     (/ (* l l) (* (pow (* k_m t) 2.0) t)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 1.22e-57) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else if (t <= 2.5e+20) {
		tmp = (l / (k_m * k_m)) * (l / pow(t, 3.0));
	} else {
		tmp = (l * l) / (pow((k_m * t), 2.0) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 1.22e-57)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	elseif (t <= 2.5e+20)
		tmp = Float64(Float64(l / Float64(k_m * k_m)) * Float64(l / (t ^ 3.0)));
	else
		tmp = Float64(Float64(l * l) / Float64((Float64(k_m * t) ^ 2.0) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 1.22e-57], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.5e+20], N[(N[(l / N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] * N[(l / N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.22 \cdot 10^{-57}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{\ell}{k\_m \cdot k\_m} \cdot \frac{\ell}{{t}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 1.2200000000000001e-57

    1. Initial program 51.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites14.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.8

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites80.8%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites53.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 1.2200000000000001e-57 < t < 2.5e20

    1. Initial program 79.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites79.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{{k}^{2}} \cdot \color{blue}{\frac{\ell}{{t}^{3}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2}} \cdot \color{blue}{\frac{\ell}{{t}^{3}}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{\ell}{{k}^{2}} \cdot \frac{\color{blue}{\ell}}{{t}^{3}} \]
      5. pow2N/A

        \[\leadsto \frac{\ell}{k \cdot k} \cdot \frac{\ell}{{t}^{3}} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{\ell}{k \cdot k} \cdot \frac{\ell}{{t}^{3}} \]
      7. lower-/.f64N/A

        \[\leadsto \frac{\ell}{k \cdot k} \cdot \frac{\ell}{\color{blue}{{t}^{3}}} \]
      8. lift-pow.f6474.9

        \[\leadsto \frac{\ell}{k \cdot k} \cdot \frac{\ell}{{t}^{\color{blue}{3}}} \]
    7. Applied rewrites74.9%

      \[\leadsto \color{blue}{\frac{\ell}{k \cdot k} \cdot \frac{\ell}{{t}^{3}}} \]

    if 2.5e20 < t

    1. Initial program 59.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6444.2

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites44.2%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      5. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. lift-*.f6444.2

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    7. Applied rewrites44.2%

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\left(t \cdot t\right) \cdot t\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left({t}^{2} \cdot t\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      9. pow-prod-downN/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      11. lower-*.f6471.6

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
    9. Applied rewrites71.6%

      \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot \color{blue}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 1.22 \cdot 10^{-57}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{+20}:\\ \;\;\;\;\frac{\ell}{k \cdot k} \cdot \frac{\ell}{{t}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 56.7% accurate, 3.4× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-33}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 3e-33)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (/ (* l l) (* (pow (* k_m t) 2.0) t))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 3e-33) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else {
		tmp = (l * l) / (pow((k_m * t), 2.0) * t);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 3e-33)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	else
		tmp = Float64(Float64(l * l) / Float64((Float64(k_m * t) ^ 2.0) * t));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 3e-33], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[Power[N[(k$95$m * t), $MachinePrecision], 2.0], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 3 \cdot 10^{-33}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{{\left(k\_m \cdot t\right)}^{2} \cdot t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 3.0000000000000002e-33

    1. Initial program 52.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites16.7%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites71.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6479.8

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites79.8%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites53.6%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 3.0000000000000002e-33 < t

    1. Initial program 61.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6448.3

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites48.3%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
      2. unpow3N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
      5. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. lift-*.f6448.3

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
    7. Applied rewrites48.3%

      \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\left(t \cdot t\right) \cdot t\right)}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      3. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\color{blue}{\left(t \cdot t\right)} \cdot t\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      6. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \left({t}^{2} \cdot t\right)} \]
      7. associate-*r*N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      8. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left({k}^{2} \cdot {t}^{2}\right) \cdot \color{blue}{t}} \]
      9. pow-prod-downN/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      10. lower-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
      11. lower-*.f6471.4

        \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t} \]
    9. Applied rewrites71.4%

      \[\leadsto \frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot \color{blue}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification59.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-33}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{{\left(k \cdot t\right)}^{2} \cdot t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 54.8% accurate, 3.4× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 6.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{k\_m \cdot \left(k\_m \cdot {t}^{3}\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 6.6e-51)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (/ (* l l) (* k_m (* k_m (pow t 3.0))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 6.6e-51) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else {
		tmp = (l * l) / (k_m * (k_m * pow(t, 3.0)));
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 6.6e-51)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	else
		tmp = Float64(Float64(l * l) / Float64(k_m * Float64(k_m * (t ^ 3.0))));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 6.6e-51], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(k$95$m * N[(k$95$m * N[Power[t, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{k\_m \cdot \left(k\_m \cdot {t}^{3}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.59999999999999946e-51

    1. Initial program 51.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites15.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6481.0

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites81.0%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites54.2%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 6.59999999999999946e-51 < t

    1. Initial program 62.5%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
      2. pow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      3. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
      5. unpow2N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      7. lift-pow.f6447.4

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
    5. Applied rewrites47.4%

      \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{{t}^{3}}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
      4. associate-*l*N/A

        \[\leadsto \frac{\ell \cdot \ell}{k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}} \]
      5. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\ell \cdot \ell}{k \cdot \left(k \cdot \color{blue}{{t}^{3}}\right)} \]
      7. lift-pow.f6456.0

        \[\leadsto \frac{\ell \cdot \ell}{k \cdot \left(k \cdot {t}^{\color{blue}{3}}\right)} \]
    7. Applied rewrites56.0%

      \[\leadsto \frac{\ell \cdot \ell}{k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification54.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 6.6 \cdot 10^{-51}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{k \cdot \left(k \cdot {t}^{3}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 53.8% accurate, 4.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 2.2e-57)
   (/
    2.0
    (*
     (/ (/ t l) l)
     (*
      (fma
       (+ (fma -0.6666666666666666 (* t t) 1.0) (* t t))
       (* k_m k_m)
       (* (* t t) 2.0))
      (* k_m k_m))))
   (/ 2.0 (* (* (* k_m k_m) (/ (/ (* (* t t) t) l) l)) 2.0))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 2.2e-57) {
		tmp = 2.0 / (((t / l) / l) * (fma((fma(-0.6666666666666666, (t * t), 1.0) + (t * t)), (k_m * k_m), ((t * t) * 2.0)) * (k_m * k_m)));
	} else {
		tmp = 2.0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0);
	}
	return tmp;
}
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 2.2e-57)
		tmp = Float64(2.0 / Float64(Float64(Float64(t / l) / l) * Float64(fma(Float64(fma(-0.6666666666666666, Float64(t * t), 1.0) + Float64(t * t)), Float64(k_m * k_m), Float64(Float64(t * t) * 2.0)) * Float64(k_m * k_m))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(Float64(Float64(Float64(t * t) * t) / l) / l)) * 2.0));
	end
	return tmp
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 2.2e-57], N[(2.0 / N[(N[(N[(t / l), $MachinePrecision] / l), $MachinePrecision] * N[(N[(N[(N[(-0.6666666666666666 * N[(t * t), $MachinePrecision] + 1.0), $MachinePrecision] + N[(t * t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k\_m \cdot k\_m, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k\_m \cdot k\_m\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.19999999999999999e-57

    1. Initial program 51.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites14.4%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left(2 \cdot \frac{{t}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k} + \frac{{k}^{2} \cdot {\sin k}^{2}}{{\ell}^{2} \cdot \cos k}\right)}} \]
    6. Applied rewrites72.6%

      \[\leadsto \frac{2}{\color{blue}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}}} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, \color{blue}{2}, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\frac{t}{\ell \cdot \ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      3. associate-/r*N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
      5. lower-/.f6480.8

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\mathsf{fma}\left(\color{blue}{{\left(\sin k \cdot t\right)}^{2}}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}{\cos k}} \]
    8. Applied rewrites80.8%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \frac{\color{blue}{\mathsf{fma}\left({\left(\sin k \cdot t\right)}^{2}, 2, {\left(\sin k \cdot k\right)}^{2}\right)}}{\cos k}} \]
    9. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left({k}^{2} \cdot \color{blue}{\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right)}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\left(2 \cdot {t}^{2} + {k}^{2} \cdot \left(\left(1 + \frac{-2}{3} \cdot {t}^{2}\right) - -1 \cdot {t}^{2}\right)\right) \cdot {k}^{\color{blue}{2}}\right)} \]
    11. Applied rewrites53.7%

      \[\leadsto \frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) - \left(-t\right) \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]

    if 2.19999999999999999e-57 < t

    1. Initial program 63.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
      2. lift-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
      3. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
      4. +-commutativeN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
      5. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
      6. frac-timesN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
      7. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
      8. unpow2N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
      9. frac-2negN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
      10. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
      11. metadata-evalN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
      12. pow-divN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
      13. frac-addN/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      14. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
    4. Applied rewrites24.0%

      \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
    5. Taylor expanded in k around 0

      \[\leadsto \frac{2}{\color{blue}{2 \cdot \frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}}}} \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}} \cdot \color{blue}{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}} \cdot \color{blue}{2}} \]
      3. associate-/l*N/A

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
      5. pow2N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
      6. lift-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
      7. pow2N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right) \cdot 2} \]
      8. associate-/r*N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
      11. lift-pow.f6451.1

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
    7. Applied rewrites51.1%

      \[\leadsto \frac{2}{\color{blue}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2}} \]
    8. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
      2. unpow3N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
      3. pow2N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{2} \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
      4. lower-*.f64N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{2} \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
      5. pow2N/A

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
      6. lower-*.f6451.1

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
    9. Applied rewrites51.1%

      \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{2}{\frac{\frac{t}{\ell}}{\ell} \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(-0.6666666666666666, t \cdot t, 1\right) + t \cdot t, k \cdot k, \left(t \cdot t\right) \cdot 2\right) \cdot \left(k \cdot k\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 58.4% accurate, 7.1× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 2.2 \cdot 10^{-57}:\\ \;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot 1}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 2.2e-57)
   (* (/ (* (* (/ l k_m) (/ l k_m)) 1.0) (* (* k_m k_m) t)) 2.0)
   (/ 2.0 (* (* (* k_m k_m) (/ (/ (* (* t t) t) l) l)) 2.0))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 2.2e-57) {
		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
	} else {
		tmp = 2.0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0);
	}
	return tmp;
}
k_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(t, l, k_m)
use fmin_fmax_functions
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t <= 2.2d-57) then
        tmp = ((((l / k_m) * (l / k_m)) * 1.0d0) / ((k_m * k_m) * t)) * 2.0d0
    else
        tmp = 2.0d0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0d0)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 2.2e-57) {
		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
	} else {
		tmp = 2.0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if t <= 2.2e-57:
		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0
	else:
		tmp = 2.0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 2.2e-57)
		tmp = Float64(Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * 1.0) / Float64(Float64(k_m * k_m) * t)) * 2.0);
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(Float64(Float64(Float64(t * t) * t) / l) / l)) * 2.0));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (t <= 2.2e-57)
		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
	else
		tmp = 2.0 / (((k_m * k_m) * ((((t * t) * t) / l) / l)) * 2.0);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 2.2e-57], N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.2 \cdot 10^{-57}:\\
\;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot 1}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 2.19999999999999999e-57

    1. Initial program 51.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
    5. Applied rewrites64.7%

      \[\leadsto \color{blue}{\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      2. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      3. lift-/.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      4. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      5. lift-/.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      6. lift-cos.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      7. lift-*.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      8. lift-pow.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      9. lift-sin.f64N/A

        \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
      10. associate-*r/N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      11. lower-/.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      13. times-fracN/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      15. lower-/.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      16. lower-/.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      17. lift-cos.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      18. lift-sin.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      19. lift-pow.f64N/A

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
    7. Applied rewrites74.7%

      \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
    8. Taylor expanded in k around 0

      \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
    9. Step-by-step derivation
      1. Applied rewrites59.1%

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
      2. Taylor expanded in k around 0

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{k}^{2} \cdot t} \cdot 2 \]
      3. Step-by-step derivation
        1. pow2N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
        2. lift-*.f6457.1

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
      4. Applied rewrites57.1%

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]

      if 2.19999999999999999e-57 < t

      1. Initial program 63.3%

        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left(1 + {\left(\frac{k}{t}\right)}^{2}\right)} + 1\right)} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\color{blue}{\left(\frac{k}{t}\right)}}^{2}\right) + 1\right)} \]
        3. lift-pow.f64N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + \color{blue}{{\left(\frac{k}{t}\right)}^{2}}\right) + 1\right)} \]
        4. +-commutativeN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\left({\left(\frac{k}{t}\right)}^{2} + 1\right)} + 1\right)} \]
        5. unpow2N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) + 1\right)} \]
        6. frac-timesN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{k \cdot k}{t \cdot t}} + 1\right) + 1\right)} \]
        7. unpow2N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\color{blue}{{k}^{2}}}{t \cdot t} + 1\right) + 1\right)} \]
        8. unpow2N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{{k}^{2}}{\color{blue}{{t}^{2}}} + 1\right) + 1\right)} \]
        9. frac-2negN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\color{blue}{\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)}} + 1\right) + 1\right)} \]
        10. metadata-evalN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{{t}^{0}}\right) + 1\right)} \]
        11. metadata-evalN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + {t}^{\color{blue}{\left(2 - 2\right)}}\right) + 1\right)} \]
        12. pow-divN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(\frac{\mathsf{neg}\left({k}^{2}\right)}{\mathsf{neg}\left({t}^{2}\right)} + \color{blue}{\frac{{t}^{2}}{{t}^{2}}}\right) + 1\right)} \]
        13. frac-addN/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
        14. lower-/.f64N/A

          \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\left(\mathsf{neg}\left({k}^{2}\right)\right) \cdot {t}^{2} + \left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}{\left(\mathsf{neg}\left({t}^{2}\right)\right) \cdot {t}^{2}}} + 1\right)} \]
      4. Applied rewrites24.0%

        \[\leadsto \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\color{blue}{\frac{\mathsf{fma}\left(-k \cdot k, t \cdot t, \left(-t \cdot t\right) \cdot \left(t \cdot t\right)\right)}{\left(-t \cdot t\right) \cdot \left(t \cdot t\right)}} + 1\right)} \]
      5. Taylor expanded in k around 0

        \[\leadsto \frac{2}{\color{blue}{2 \cdot \frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}}}} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}} \cdot \color{blue}{2}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{2}{\frac{{k}^{2} \cdot {t}^{3}}{{\ell}^{2}} \cdot \color{blue}{2}} \]
        3. associate-/l*N/A

          \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{2}{\left({k}^{2} \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
        5. pow2N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
        6. lift-*.f64N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{{\ell}^{2}}\right) \cdot 2} \]
        7. pow2N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{{t}^{3}}{\ell \cdot \ell}\right) \cdot 2} \]
        8. associate-/r*N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
        10. lower-/.f64N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
        11. lift-pow.f6451.1

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
      7. Applied rewrites51.1%

        \[\leadsto \frac{2}{\color{blue}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2}} \]
      8. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{3}}{\ell}}{\ell}\right) \cdot 2} \]
        2. unpow3N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
        3. pow2N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{2} \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{{t}^{2} \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
        5. pow2N/A

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
        6. lower-*.f6451.1

          \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
      9. Applied rewrites51.1%

        \[\leadsto \frac{2}{\left(\left(k \cdot k\right) \cdot \frac{\frac{\left(t \cdot t\right) \cdot t}{\ell}}{\ell}\right) \cdot 2} \]
    10. Recombined 2 regimes into one program.
    11. Add Preprocessing

    Alternative 24: 57.3% accurate, 7.1× speedup?

    \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 1.22 \cdot 10^{-17}:\\ \;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot 1}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\ \end{array} \end{array} \]
    k_m = (fabs.f64 k)
    (FPCore (t l k_m)
     :precision binary64
     (if (<= t 1.22e-17)
       (* (/ (* (* (/ l k_m) (/ l k_m)) 1.0) (* (* k_m k_m) t)) 2.0)
       (/ (* l l) (* (* k_m k_m) (* (* t t) t)))))
    k_m = fabs(k);
    double code(double t, double l, double k_m) {
    	double tmp;
    	if (t <= 1.22e-17) {
    		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
    	} else {
    		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
    	}
    	return tmp;
    }
    
    k_m =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(t, l, k_m)
    use fmin_fmax_functions
        real(8), intent (in) :: t
        real(8), intent (in) :: l
        real(8), intent (in) :: k_m
        real(8) :: tmp
        if (t <= 1.22d-17) then
            tmp = ((((l / k_m) * (l / k_m)) * 1.0d0) / ((k_m * k_m) * t)) * 2.0d0
        else
            tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
        end if
        code = tmp
    end function
    
    k_m = Math.abs(k);
    public static double code(double t, double l, double k_m) {
    	double tmp;
    	if (t <= 1.22e-17) {
    		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
    	} else {
    		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
    	}
    	return tmp;
    }
    
    k_m = math.fabs(k)
    def code(t, l, k_m):
    	tmp = 0
    	if t <= 1.22e-17:
    		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0
    	else:
    		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
    	return tmp
    
    k_m = abs(k)
    function code(t, l, k_m)
    	tmp = 0.0
    	if (t <= 1.22e-17)
    		tmp = Float64(Float64(Float64(Float64(Float64(l / k_m) * Float64(l / k_m)) * 1.0) / Float64(Float64(k_m * k_m) * t)) * 2.0);
    	else
    		tmp = Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t)));
    	end
    	return tmp
    end
    
    k_m = abs(k);
    function tmp_2 = code(t, l, k_m)
    	tmp = 0.0;
    	if (t <= 1.22e-17)
    		tmp = ((((l / k_m) * (l / k_m)) * 1.0) / ((k_m * k_m) * t)) * 2.0;
    	else
    		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
    	end
    	tmp_2 = tmp;
    end
    
    k_m = N[Abs[k], $MachinePrecision]
    code[t_, l_, k$95$m_] := If[LessEqual[t, 1.22e-17], N[(N[(N[(N[(N[(l / k$95$m), $MachinePrecision] * N[(l / k$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    k_m = \left|k\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq 1.22 \cdot 10^{-17}:\\
    \;\;\;\;\frac{\left(\frac{\ell}{k\_m} \cdot \frac{\ell}{k\_m}\right) \cdot 1}{\left(k\_m \cdot k\_m\right) \cdot t} \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 1.22e-17

      1. Initial program 52.1%

        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in t around 0

        \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
      5. Applied rewrites63.9%

        \[\leadsto \color{blue}{\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        2. lift-*.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        3. lift-/.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        4. lift-*.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        5. lift-/.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        6. lift-cos.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        7. lift-*.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        8. lift-pow.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        9. lift-sin.f64N/A

          \[\leadsto \left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2 \]
        10. associate-*r/N/A

          \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        11. lower-/.f64N/A

          \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        12. lower-*.f64N/A

          \[\leadsto \frac{\frac{\ell \cdot \ell}{k \cdot k} \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        13. times-fracN/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        14. lower-*.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        15. lower-/.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        16. lower-/.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        17. lift-cos.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        18. lift-sin.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
        19. lift-pow.f64N/A

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      7. Applied rewrites75.0%

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot \cos k}{{\sin k}^{2} \cdot t} \cdot 2 \]
      8. Taylor expanded in k around 0

        \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
      9. Step-by-step derivation
        1. Applied rewrites58.9%

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{\sin k}^{2} \cdot t} \cdot 2 \]
        2. Taylor expanded in k around 0

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{{k}^{2} \cdot t} \cdot 2 \]
        3. Step-by-step derivation
          1. pow2N/A

            \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
          2. lift-*.f6456.9

            \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]
        4. Applied rewrites56.9%

          \[\leadsto \frac{\left(\frac{\ell}{k} \cdot \frac{\ell}{k}\right) \cdot 1}{\left(k \cdot k\right) \cdot t} \cdot 2 \]

        if 1.22e-17 < t

        1. Initial program 62.5%

          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in k around 0

          \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
          2. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          5. unpow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          7. lift-pow.f6448.3

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
        5. Applied rewrites48.3%

          \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
        6. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
          2. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          3. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          5. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          6. lift-*.f6448.2

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        7. Applied rewrites48.2%

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 25: 53.8% accurate, 8.6× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 3 \cdot 10^{-33}:\\ \;\;\;\;\frac{\frac{\ell \cdot \ell}{t}}{\left(k\_m \cdot k\_m\right) \cdot \left(k\_m \cdot k\_m\right)} \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\ \end{array} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (if (<= t 3e-33)
         (* (/ (/ (* l l) t) (* (* k_m k_m) (* k_m k_m))) 2.0)
         (/ (* l l) (* (* k_m k_m) (* (* t t) t)))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	double tmp;
      	if (t <= 3e-33) {
      		tmp = (((l * l) / t) / ((k_m * k_m) * (k_m * k_m))) * 2.0;
      	} else {
      		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
      	}
      	return tmp;
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          real(8) :: tmp
          if (t <= 3d-33) then
              tmp = (((l * l) / t) / ((k_m * k_m) * (k_m * k_m))) * 2.0d0
          else
              tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
          end if
          code = tmp
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	double tmp;
      	if (t <= 3e-33) {
      		tmp = (((l * l) / t) / ((k_m * k_m) * (k_m * k_m))) * 2.0;
      	} else {
      		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
      	}
      	return tmp;
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	tmp = 0
      	if t <= 3e-33:
      		tmp = (((l * l) / t) / ((k_m * k_m) * (k_m * k_m))) * 2.0
      	else:
      		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t))
      	return tmp
      
      k_m = abs(k)
      function code(t, l, k_m)
      	tmp = 0.0
      	if (t <= 3e-33)
      		tmp = Float64(Float64(Float64(Float64(l * l) / t) / Float64(Float64(k_m * k_m) * Float64(k_m * k_m))) * 2.0);
      	else
      		tmp = Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t)));
      	end
      	return tmp
      end
      
      k_m = abs(k);
      function tmp_2 = code(t, l, k_m)
      	tmp = 0.0;
      	if (t <= 3e-33)
      		tmp = (((l * l) / t) / ((k_m * k_m) * (k_m * k_m))) * 2.0;
      	else
      		tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
      	end
      	tmp_2 = tmp;
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := If[LessEqual[t, 3e-33], N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq 3 \cdot 10^{-33}:\\
      \;\;\;\;\frac{\frac{\ell \cdot \ell}{t}}{\left(k\_m \cdot k\_m\right) \cdot \left(k\_m \cdot k\_m\right)} \cdot 2\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < 3.0000000000000002e-33

        1. Initial program 52.1%

          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in t around 0

          \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)}} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{{\ell}^{2} \cdot \cos k}{{k}^{2} \cdot \left(t \cdot {\sin k}^{2}\right)} \cdot \color{blue}{2} \]
        5. Applied rewrites64.3%

          \[\leadsto \color{blue}{\left(\frac{\ell \cdot \ell}{k \cdot k} \cdot \frac{\cos k}{{\sin k}^{2} \cdot t}\right) \cdot 2} \]
        6. Taylor expanded in k around 0

          \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{{\ell}^{2}}{t} - \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right) + \frac{{\ell}^{2}}{t}}{{k}^{4}} \cdot 2 \]
        7. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-1}{2} \cdot \frac{{\ell}^{2}}{t} - \frac{-1}{3} \cdot \frac{{\ell}^{2}}{t}\right) + \frac{{\ell}^{2}}{t}}{{k}^{4}} \cdot 2 \]
        8. Applied rewrites25.2%

          \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot -0.16666666666666666, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{{k}^{4}} \cdot 2 \]
        9. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{{k}^{4}} \cdot 2 \]
          2. metadata-evalN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{{k}^{\left(2 + 2\right)}} \cdot 2 \]
          3. pow-prod-upN/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{{k}^{2} \cdot {k}^{2}} \cdot 2 \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{{k}^{2} \cdot {k}^{2}} \cdot 2 \]
          5. pow2N/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot 2 \]
          6. lift-*.f64N/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{\left(k \cdot k\right) \cdot {k}^{2}} \cdot 2 \]
          7. pow2N/A

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot \frac{-1}{6}, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
          8. lift-*.f6425.2

            \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot -0.16666666666666666, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
        10. Applied rewrites25.2%

          \[\leadsto \frac{\mathsf{fma}\left(\frac{\ell \cdot \ell}{t} \cdot -0.16666666666666666, k \cdot k, \frac{\ell \cdot \ell}{t}\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
        11. Taylor expanded in k around 0

          \[\leadsto \frac{\frac{{\ell}^{2}}{t}}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
        12. Step-by-step derivation
          1. pow2N/A

            \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
          2. lift-/.f64N/A

            \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
          3. lift-*.f6452.3

            \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]
        13. Applied rewrites52.3%

          \[\leadsto \frac{\frac{\ell \cdot \ell}{t}}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)} \cdot 2 \]

        if 3.0000000000000002e-33 < t

        1. Initial program 61.9%

          \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in k around 0

          \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
          2. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
          3. lift-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
          5. unpow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          6. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
          7. lift-pow.f6448.3

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
        5. Applied rewrites48.3%

          \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
        6. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
          2. unpow3N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
          3. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
          5. pow2N/A

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
          6. lift-*.f6448.3

            \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        7. Applied rewrites48.3%

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 26: 50.1% accurate, 12.5× speedup?

      \[\begin{array}{l} k_m = \left|k\right| \\ \frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \end{array} \]
      k_m = (fabs.f64 k)
      (FPCore (t l k_m)
       :precision binary64
       (/ (* l l) (* (* k_m k_m) (* (* t t) t))))
      k_m = fabs(k);
      double code(double t, double l, double k_m) {
      	return (l * l) / ((k_m * k_m) * ((t * t) * t));
      }
      
      k_m =     private
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(t, l, k_m)
      use fmin_fmax_functions
          real(8), intent (in) :: t
          real(8), intent (in) :: l
          real(8), intent (in) :: k_m
          code = (l * l) / ((k_m * k_m) * ((t * t) * t))
      end function
      
      k_m = Math.abs(k);
      public static double code(double t, double l, double k_m) {
      	return (l * l) / ((k_m * k_m) * ((t * t) * t));
      }
      
      k_m = math.fabs(k)
      def code(t, l, k_m):
      	return (l * l) / ((k_m * k_m) * ((t * t) * t))
      
      k_m = abs(k)
      function code(t, l, k_m)
      	return Float64(Float64(l * l) / Float64(Float64(k_m * k_m) * Float64(Float64(t * t) * t)))
      end
      
      k_m = abs(k);
      function tmp = code(t, l, k_m)
      	tmp = (l * l) / ((k_m * k_m) * ((t * t) * t));
      end
      
      k_m = N[Abs[k], $MachinePrecision]
      code[t_, l_, k$95$m_] := N[(N[(l * l), $MachinePrecision] / N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
      
      \begin{array}{l}
      k_m = \left|k\right|
      
      \\
      \frac{\ell \cdot \ell}{\left(k\_m \cdot k\_m\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)}
      \end{array}
      
      Derivation
      1. Initial program 55.2%

        \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in k around 0

        \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{k}^{2} \cdot {t}^{3}}} \]
        2. pow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
        3. lift-*.f64N/A

          \[\leadsto \frac{\ell \cdot \ell}{\color{blue}{{k}^{2}} \cdot {t}^{3}} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{\ell \cdot \ell}{{k}^{2} \cdot \color{blue}{{t}^{3}}} \]
        5. unpow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {\color{blue}{t}}^{3}} \]
        7. lift-pow.f6447.4

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
      5. Applied rewrites47.4%

        \[\leadsto \color{blue}{\frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{3}}} \]
      6. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot {t}^{\color{blue}{3}}} \]
        2. unpow3N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
        3. pow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot t\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left({t}^{2} \cdot \color{blue}{t}\right)} \]
        5. pow2N/A

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
        6. lift-*.f6447.3

          \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot t\right)} \]
      7. Applied rewrites47.3%

        \[\leadsto \frac{\ell \cdot \ell}{\left(k \cdot k\right) \cdot \left(\left(t \cdot t\right) \cdot \color{blue}{t}\right)} \]
      8. Add Preprocessing

      Reproduce

      ?
      herbie shell --seed 2025057 
      (FPCore (t l k)
        :name "Toniolo and Linder, Equation (10+)"
        :precision binary64
        (/ 2.0 (* (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k)) (+ (+ 1.0 (pow (/ k t) 2.0)) 1.0))))