Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.3% → 95.4%
Time: 17.8s
Alternatives: 15
Speedup: 28.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));
}
real(8) function code(t, l, k)
    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 15 alternatives:

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

Initial Program: 35.3% 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));
}
real(8) function code(t, l, k)
    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: 95.4% accurate, 1.3× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 5.8 \cdot 10^{-134}:\\ \;\;\;\;{\left(\frac{k\_m}{\frac{\ell}{k\_m}}\right)}^{-1} \cdot {\left(\frac{\frac{k\_m}{\frac{\ell}{k\_m \cdot t}}}{2}\right)}^{-1}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(k\_m \cdot \left(t \cdot \frac{k\_m}{\ell}\right)\right) \cdot \frac{{\sin k\_m}^{2}}{\ell}}{\cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 5.8e-134)
   (* (pow (/ k_m (/ l k_m)) -1.0) (pow (/ (/ k_m (/ l (* k_m t))) 2.0) -1.0))
   (/
    2.0
    (/ (* (* k_m (* t (/ k_m l))) (/ (pow (sin k_m) 2.0) l)) (cos k_m)))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 5.8e-134) {
		tmp = pow((k_m / (l / k_m)), -1.0) * pow(((k_m / (l / (k_m * t))) / 2.0), -1.0);
	} else {
		tmp = 2.0 / (((k_m * (t * (k_m / l))) * (pow(sin(k_m), 2.0) / l)) / cos(k_m));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 5.8d-134) then
        tmp = ((k_m / (l / k_m)) ** (-1.0d0)) * (((k_m / (l / (k_m * t))) / 2.0d0) ** (-1.0d0))
    else
        tmp = 2.0d0 / (((k_m * (t * (k_m / l))) * ((sin(k_m) ** 2.0d0) / l)) / cos(k_m))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 5.8e-134) {
		tmp = Math.pow((k_m / (l / k_m)), -1.0) * Math.pow(((k_m / (l / (k_m * t))) / 2.0), -1.0);
	} else {
		tmp = 2.0 / (((k_m * (t * (k_m / l))) * (Math.pow(Math.sin(k_m), 2.0) / l)) / Math.cos(k_m));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 5.8e-134:
		tmp = math.pow((k_m / (l / k_m)), -1.0) * math.pow(((k_m / (l / (k_m * t))) / 2.0), -1.0)
	else:
		tmp = 2.0 / (((k_m * (t * (k_m / l))) * (math.pow(math.sin(k_m), 2.0) / l)) / math.cos(k_m))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 5.8e-134)
		tmp = Float64((Float64(k_m / Float64(l / k_m)) ^ -1.0) * (Float64(Float64(k_m / Float64(l / Float64(k_m * t))) / 2.0) ^ -1.0));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(t * Float64(k_m / l))) * Float64((sin(k_m) ^ 2.0) / l)) / cos(k_m)));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 5.8e-134)
		tmp = ((k_m / (l / k_m)) ^ -1.0) * (((k_m / (l / (k_m * t))) / 2.0) ^ -1.0);
	else
		tmp = 2.0 / (((k_m * (t * (k_m / l))) * ((sin(k_m) ^ 2.0) / l)) / cos(k_m));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 5.8e-134], N[(N[Power[N[(k$95$m / N[(l / k$95$m), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(N[(k$95$m / N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * N[(t * N[(k$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Sin[k$95$m], $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6459.8%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified59.8%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6454.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr54.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr78.2%

      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}} \cdot \ell} \]
    10. Applied egg-rr80.9%

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

    if 5.79999999999999986e-134 < k

    1. Initial program 31.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6479.0%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified79.0%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6492.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr92.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(t \cdot \frac{k}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(\frac{k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f6495.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{/.f64}\left(k, \ell\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    9. Applied egg-rr95.4%

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

Alternative 2: 95.4% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k\_m \cdot \left(0.5 + \cos \left(k\_m \cdot 2\right) \cdot -0.5\right)}{\ell} \cdot \left(k\_m \cdot \frac{t}{\ell \cdot \cos k\_m}\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.7e-6)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/
    2.0
    (*
     (/ (* k_m (+ 0.5 (* (cos (* k_m 2.0)) -0.5))) l)
     (* k_m (/ t (* l (cos k_m))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * (0.5 + (cos((k_m * 2.0)) * -0.5))) / l) * (k_m * (t / (l * cos(k_m)))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.7d-6) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = 2.0d0 / (((k_m * (0.5d0 + (cos((k_m * 2.0d0)) * (-0.5d0)))) / l) * (k_m * (t / (l * cos(k_m)))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * (0.5 + (Math.cos((k_m * 2.0)) * -0.5))) / l) * (k_m * (t / (l * Math.cos(k_m)))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.7e-6:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = 2.0 / (((k_m * (0.5 + (math.cos((k_m * 2.0)) * -0.5))) / l) * (k_m * (t / (l * math.cos(k_m)))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.7e-6)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * Float64(0.5 + Float64(cos(Float64(k_m * 2.0)) * -0.5))) / l) * Float64(k_m * Float64(t / Float64(l * cos(k_m))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.7e-6)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = 2.0 / (((k_m * (0.5 + (cos((k_m * 2.0)) * -0.5))) / l) * (k_m * (t / (l * cos(k_m)))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.7e-6], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * N[(0.5 + N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] * N[(k$95$m * N[(t / N[(l * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

    1. Initial program 39.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.2%

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

    if 6.7e-6 < k

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified72.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(\frac{\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)}{\ell} \cdot k\right), \color{blue}{\left(k \cdot \frac{\frac{t}{\ell}}{\cos k}\right)}\right)\right) \]
    9. Applied egg-rr93.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k \cdot \left(0.5 + \cos \left(k \cdot 2\right) \cdot -0.5\right)}{\ell} \cdot \left(k \cdot \frac{t}{\ell \cdot \cos k}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 95.1% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k\_m}{\frac{\ell}{t}} \cdot \left(k\_m \cdot \frac{0.5 + \cos \left(k\_m \cdot 2\right) \cdot -0.5}{\ell \cdot \cos k\_m}\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.7e-6)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/
    2.0
    (*
     (/ k_m (/ l t))
     (* k_m (/ (+ 0.5 (* (cos (* k_m 2.0)) -0.5)) (* l (cos k_m))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / ((k_m / (l / t)) * (k_m * ((0.5 + (cos((k_m * 2.0)) * -0.5)) / (l * cos(k_m)))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.7d-6) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = 2.0d0 / ((k_m / (l / t)) * (k_m * ((0.5d0 + (cos((k_m * 2.0d0)) * (-0.5d0))) / (l * cos(k_m)))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / ((k_m / (l / t)) * (k_m * ((0.5 + (Math.cos((k_m * 2.0)) * -0.5)) / (l * Math.cos(k_m)))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.7e-6:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = 2.0 / ((k_m / (l / t)) * (k_m * ((0.5 + (math.cos((k_m * 2.0)) * -0.5)) / (l * math.cos(k_m)))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.7e-6)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(2.0 / Float64(Float64(k_m / Float64(l / t)) * Float64(k_m * Float64(Float64(0.5 + Float64(cos(Float64(k_m * 2.0)) * -0.5)) / Float64(l * cos(k_m))))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.7e-6)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = 2.0 / ((k_m / (l / t)) * (k_m * ((0.5 + (cos((k_m * 2.0)) * -0.5)) / (l * cos(k_m)))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.7e-6], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(k$95$m / N[(l / t), $MachinePrecision]), $MachinePrecision] * N[(k$95$m * N[(N[(0.5 + N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

    1. Initial program 39.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.2%

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

    if 6.7e-6 < k

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified72.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr90.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left(k \cdot \frac{1}{\frac{\ell}{t}}\right), \left(k \cdot \frac{\frac{{\sin k}^{2}}{\ell}}{\cos k}\right)\right)\right) \]
      11. un-div-invN/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, t\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \color{blue}{\left(\cos k \cdot \ell\right)}\right)\right)\right)\right) \]
    9. Applied egg-rr93.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k}{\frac{\ell}{t}} \cdot \left(k \cdot \frac{0.5 + \cos \left(k \cdot 2\right) \cdot -0.5}{\ell \cdot \cos k}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 94.1% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k\_m \cdot \frac{\frac{\frac{k\_m}{\frac{\ell}{t}}}{\frac{\ell}{0.5 + \cos \left(k\_m \cdot 2\right) \cdot -0.5}}}{\cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 6.7e-6)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/
    2.0
    (*
     k_m
     (/
      (/ (/ k_m (/ l t)) (/ l (+ 0.5 (* (cos (* k_m 2.0)) -0.5))))
      (cos k_m))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (k_m * (((k_m / (l / t)) / (l / (0.5 + (cos((k_m * 2.0)) * -0.5)))) / cos(k_m)));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 6.7d-6) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = 2.0d0 / (k_m * (((k_m / (l / t)) / (l / (0.5d0 + (cos((k_m * 2.0d0)) * (-0.5d0))))) / cos(k_m)))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (k_m * (((k_m / (l / t)) / (l / (0.5 + (Math.cos((k_m * 2.0)) * -0.5)))) / Math.cos(k_m)));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 6.7e-6:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = 2.0 / (k_m * (((k_m / (l / t)) / (l / (0.5 + (math.cos((k_m * 2.0)) * -0.5)))) / math.cos(k_m)))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 6.7e-6)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(2.0 / Float64(k_m * Float64(Float64(Float64(k_m / Float64(l / t)) / Float64(l / Float64(0.5 + Float64(cos(Float64(k_m * 2.0)) * -0.5)))) / cos(k_m))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 6.7e-6)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = 2.0 / (k_m * (((k_m / (l / t)) / (l / (0.5 + (cos((k_m * 2.0)) * -0.5)))) / cos(k_m)));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 6.7e-6], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(k$95$m * N[(N[(N[(k$95$m / N[(l / t), $MachinePrecision]), $MachinePrecision] / N[(l / N[(0.5 + N[(N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

    1. Initial program 39.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.2%

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

    if 6.7e-6 < k

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified72.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr90.3%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(\frac{k \cdot t}{\ell} \cdot \frac{{\sin k}^{2}}{\ell}\right), \color{blue}{\cos k}\right)\right)\right) \]
    9. Applied egg-rr91.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k \cdot \frac{\frac{\frac{k}{\frac{\ell}{t}}}{\frac{\ell}{0.5 + \cos \left(k \cdot 2\right) \cdot -0.5}}}{\cos k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.2% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} t_1 := \frac{\ell}{k\_m \cdot t}\\ \mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - t\_1}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{t\_1}{k\_m}}{\frac{0.5 - 0.5 \cdot \cos \left(k\_m \cdot 2\right)}{\ell \cdot \cos k\_m}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (let* ((t_1 (/ l (* k_m t))))
   (if (<= k_m 6.7e-6)
     (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 t_1)))
     (*
      2.0
      (/ (/ t_1 k_m) (/ (- 0.5 (* 0.5 (cos (* k_m 2.0)))) (* l (cos k_m))))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double t_1 = l / (k_m * t);
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - t_1));
	} else {
		tmp = 2.0 * ((t_1 / k_m) / ((0.5 - (0.5 * cos((k_m * 2.0)))) / (l * cos(k_m))));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    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 * t)
    if (k_m <= 6.7d-6) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - t_1))
    else
        tmp = 2.0d0 * ((t_1 / k_m) / ((0.5d0 - (0.5d0 * cos((k_m * 2.0d0)))) / (l * cos(k_m))))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double t_1 = l / (k_m * t);
	double tmp;
	if (k_m <= 6.7e-6) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - t_1));
	} else {
		tmp = 2.0 * ((t_1 / k_m) / ((0.5 - (0.5 * Math.cos((k_m * 2.0)))) / (l * Math.cos(k_m))));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	t_1 = l / (k_m * t)
	tmp = 0
	if k_m <= 6.7e-6:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - t_1))
	else:
		tmp = 2.0 * ((t_1 / k_m) / ((0.5 - (0.5 * math.cos((k_m * 2.0)))) / (l * math.cos(k_m))))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	t_1 = Float64(l / Float64(k_m * t))
	tmp = 0.0
	if (k_m <= 6.7e-6)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - t_1)));
	else
		tmp = Float64(2.0 * Float64(Float64(t_1 / k_m) / Float64(Float64(0.5 - Float64(0.5 * cos(Float64(k_m * 2.0)))) / Float64(l * cos(k_m)))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	t_1 = l / (k_m * t);
	tmp = 0.0;
	if (k_m <= 6.7e-6)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - t_1));
	else
		tmp = 2.0 * ((t_1 / k_m) / ((0.5 - (0.5 * cos((k_m * 2.0)))) / (l * cos(k_m))));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := Block[{t$95$1 = N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k$95$m, 6.7e-6], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(t$95$1 / k$95$m), $MachinePrecision] / N[(N[(0.5 - N[(0.5 * N[Cos[N[(k$95$m * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(l * N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
t_1 := \frac{\ell}{k\_m \cdot t}\\
\mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - t\_1}}\\

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


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

    1. Initial program 39.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.2%

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

    if 6.7e-6 < k

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified72.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr90.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(t \cdot \frac{k}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(\frac{k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f6493.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{/.f64}\left(k, \ell\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    9. Applied egg-rr93.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\cos k}{\left(k \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \frac{{\sin k}^{2}}{\ell}}\right), \color{blue}{2}\right) \]
    11. Applied egg-rr90.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\frac{\frac{\ell}{k \cdot t}}{k}}{\frac{0.5 - 0.5 \cdot \cos \left(k \cdot 2\right)}{\ell \cdot \cos k}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 91.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_1 := \frac{\ell}{k\_m \cdot t}\\
\mathbf{if}\;k\_m \leq 6.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - t\_1}}\\

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


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

    1. Initial program 39.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.5%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.2%

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

    if 6.7e-6 < k

    1. Initial program 25.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6472.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified72.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot \frac{k \cdot t}{\ell}\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(\frac{k \cdot t}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\left(k \cdot t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      5. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, t\right), \ell\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr90.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \left(t \cdot \frac{k}{\ell}\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \left(\frac{k}{\ell}\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      4. /-lowering-/.f6493.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, \mathsf{*.f64}\left(t, \mathsf{/.f64}\left(k, \ell\right)\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    9. Applied egg-rr93.4%

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\left(k \cdot \left(t \cdot \frac{k}{\ell}\right)\right) \cdot \frac{{\sin k}^{2}}{\ell}}\right), \color{blue}{\cos k}\right) \]
    11. Applied egg-rr87.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 6.7 \cdot 10^{-6}:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\cos k \cdot \frac{2}{k \cdot \frac{0.5 - 0.5 \cdot \cos \left(k \cdot 2\right)}{\ell \cdot \frac{\ell}{k \cdot t}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.8% accurate, 1.9× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;t \leq 7.6 \cdot 10^{-66}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(k\_m \cdot k\_m\right) \cdot \frac{k\_m \cdot k\_m}{\ell}\right) \cdot \frac{t}{\ell}}{\cos k\_m}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{k\_m}{\frac{\ell}{k\_m}}\right)}^{-1} \cdot {\left(\frac{\frac{k\_m}{\frac{\ell}{k\_m \cdot t}}}{2}\right)}^{-1}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= t 7.6e-66)
   (/ 2.0 (/ (* (* (* k_m k_m) (/ (* k_m k_m) l)) (/ t l)) (cos k_m)))
   (*
    (pow (/ k_m (/ l k_m)) -1.0)
    (pow (/ (/ k_m (/ l (* k_m t))) 2.0) -1.0))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (t <= 7.6e-66) {
		tmp = 2.0 / ((((k_m * k_m) * ((k_m * k_m) / l)) * (t / l)) / cos(k_m));
	} else {
		tmp = pow((k_m / (l / k_m)), -1.0) * pow(((k_m / (l / (k_m * t))) / 2.0), -1.0);
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (t <= 7.6d-66) then
        tmp = 2.0d0 / ((((k_m * k_m) * ((k_m * k_m) / l)) * (t / l)) / cos(k_m))
    else
        tmp = ((k_m / (l / k_m)) ** (-1.0d0)) * (((k_m / (l / (k_m * t))) / 2.0d0) ** (-1.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 <= 7.6e-66) {
		tmp = 2.0 / ((((k_m * k_m) * ((k_m * k_m) / l)) * (t / l)) / Math.cos(k_m));
	} else {
		tmp = Math.pow((k_m / (l / k_m)), -1.0) * Math.pow(((k_m / (l / (k_m * t))) / 2.0), -1.0);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if t <= 7.6e-66:
		tmp = 2.0 / ((((k_m * k_m) * ((k_m * k_m) / l)) * (t / l)) / math.cos(k_m))
	else:
		tmp = math.pow((k_m / (l / k_m)), -1.0) * math.pow(((k_m / (l / (k_m * t))) / 2.0), -1.0)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (t <= 7.6e-66)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(k_m * k_m) * Float64(Float64(k_m * k_m) / l)) * Float64(t / l)) / cos(k_m)));
	else
		tmp = Float64((Float64(k_m / Float64(l / k_m)) ^ -1.0) * (Float64(Float64(k_m / Float64(l / Float64(k_m * t))) / 2.0) ^ -1.0));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (t <= 7.6e-66)
		tmp = 2.0 / ((((k_m * k_m) * ((k_m * k_m) / l)) * (t / l)) / cos(k_m));
	else
		tmp = ((k_m / (l / k_m)) ^ -1.0) * (((k_m / (l / (k_m * t))) / 2.0) ^ -1.0);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[t, 7.6e-66], N[(2.0 / N[(N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(N[(k$95$m * k$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(t / l), $MachinePrecision]), $MachinePrecision] / N[Cos[k$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(k$95$m / N[(l / k$95$m), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(N[(k$95$m / N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.5999999999999995e-66

    1. Initial program 37.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6480.7%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified80.7%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \cos \left(2 \cdot k\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      11. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(2 \cdot k\right)\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      14. /-lowering-/.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr70.5%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left({k}^{2}\right)}, \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(k \cdot k\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      2. *-lowering-*.f6469.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    10. Simplified69.5%

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

    if 7.5999999999999995e-66 < t

    1. Initial program 31.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6464.6%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified64.6%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6466.9%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr66.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr82.2%

      \[\leadsto \color{blue}{\frac{2}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}} \cdot \ell} \]
    10. Applied egg-rr82.7%

      \[\leadsto \color{blue}{{\left(\frac{k}{\frac{\ell}{k}}\right)}^{-1} \cdot {\left(\frac{\frac{k}{\frac{\ell}{k \cdot t}}}{2}\right)}^{-1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.9%

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

Alternative 8: 73.8% accurate, 3.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 6.0000000000000004e-66

    1. Initial program 37.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      9. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \left(\frac{{\sin k}^{2}}{\ell}\right)\right), \cos k\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\left({\sin k}^{2}\right), \ell\right)\right), \cos k\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\sin k, 2\right), \ell\right)\right), \cos k\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \cos k\right)\right) \]
      14. cos-lowering-cos.f6480.7%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{sin.f64}\left(k\right), 2\right), \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    5. Simplified80.7%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} - \frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \left(\frac{1}{2} \cdot \cos \left(2 \cdot k\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \cos \left(2 \cdot k\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      11. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\left(2 \cdot k\right)\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \left(k \cdot k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{\ell}\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      14. /-lowering-/.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(2, k\right)\right)\right)\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    7. Applied egg-rr70.5%

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left({k}^{2}\right)}, \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    9. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(k \cdot k\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
      2. *-lowering-*.f6469.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \ell\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \mathsf{cos.f64}\left(k\right)\right)\right) \]
    10. Simplified69.5%

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

    if 6.0000000000000004e-66 < t

    1. Initial program 31.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6464.6%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified64.6%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6466.9%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr66.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr82.2%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr82.7%

      \[\leadsto \color{blue}{\frac{-\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{\frac{\ell}{k \cdot t}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.9%

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

Alternative 9: 74.4% accurate, 17.5× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 21000000000000:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(\ell \cdot \frac{t \cdot \left(k\_m \cdot k\_m\right)}{\ell \cdot \ell}\right)}{\ell}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 21000000000000.0)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/ 2.0 (/ (* (* k_m k_m) (* l (/ (* t (* k_m k_m)) (* l l)))) l))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 21000000000000.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * k_m) * (l * ((t * (k_m * k_m)) / (l * l)))) / l);
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 21000000000000.0d0) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = 2.0d0 / (((k_m * k_m) * (l * ((t * (k_m * k_m)) / (l * l)))) / l)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 21000000000000.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * k_m) * (l * ((t * (k_m * k_m)) / (l * l)))) / l);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 21000000000000.0:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = 2.0 / (((k_m * k_m) * (l * ((t * (k_m * k_m)) / (l * l)))) / l)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 21000000000000.0)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(l * Float64(Float64(t * Float64(k_m * k_m)) / Float64(l * l)))) / l));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 21000000000000.0)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = 2.0 / (((k_m * k_m) * (l * ((t * (k_m * k_m)) / (l * l)))) / l);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 21000000000000.0], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(l * N[(N[(t * N[(k$95$m * k$95$m), $MachinePrecision]), $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 21000000000000:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

    1. Initial program 38.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.2%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.2%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6457.7%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr57.7%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr79.8%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr82.5%

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

    if 2.1e13 < k

    1. Initial program 25.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6444.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified44.3%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6450.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr50.1%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\mathsf{neg}\left(\ell\right)}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      2. sub0-negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{0 - \ell}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      3. flip--N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\frac{0 \cdot 0 - \ell \cdot \ell}{0 + \ell}}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\frac{0 - \ell \cdot \ell}{0 + \ell}}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      5. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\frac{\mathsf{neg}\left(\ell \cdot \ell\right)}{0 + \ell}}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      6. +-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\frac{\mathsf{neg}\left(\ell \cdot \ell\right)}{\ell}}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\mathsf{neg}\left(\ell \cdot \ell\right)} \cdot \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\frac{\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)}{\mathsf{neg}\left(\ell \cdot \ell\right)}\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\left(k \cdot k\right) \cdot t\right)\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(0 - \left(k \cdot k\right) \cdot t\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left(\left(k \cdot k\right) \cdot t\right)\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \left(t \cdot \left(k \cdot k\right)\right)\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(t, \left(k \cdot k\right)\right)\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right)\right), \left(\mathsf{neg}\left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right)\right), \left(0 - \ell \cdot \ell\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      16. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right)\right), \mathsf{\_.f64}\left(0, \left(\ell \cdot \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      17. *-lowering-*.f6449.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right)\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
    9. Applied egg-rr49.5%

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \color{blue}{\frac{0 - t \cdot \left(k \cdot k\right)}{0 - \ell \cdot \ell} \cdot \ell}\right)}{0 - \ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification73.6%

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

Alternative 10: 74.8% accurate, 19.1× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 1950:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(k\_m \cdot k\_m\right) \cdot \left(k\_m \cdot \frac{k\_m}{\frac{\ell}{t}}\right)}{\ell}}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 1950.0)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/ 2.0 (/ (* (* k_m k_m) (* k_m (/ k_m (/ l t)))) l))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1950.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * k_m) * (k_m * (k_m / (l / t)))) / l);
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 1950.0d0) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = 2.0d0 / (((k_m * k_m) * (k_m * (k_m / (l / t)))) / l)
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 1950.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = 2.0 / (((k_m * k_m) * (k_m * (k_m / (l / t)))) / l);
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 1950.0:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = 2.0 / (((k_m * k_m) * (k_m * (k_m / (l / t)))) / l)
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 1950.0)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(k_m * k_m) * Float64(k_m * Float64(k_m / Float64(l / t)))) / l));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 1950.0)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = 2.0 / (((k_m * k_m) * (k_m * (k_m / (l / t)))) / l);
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 1950.0], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] * N[(k$95$m * N[(k$95$m / N[(l / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 1950:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

    1. Initial program 39.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.7%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.7%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.3%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.6%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr83.3%

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

    if 1950 < k

    1. Initial program 24.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6443.1%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified43.1%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6448.7%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr48.7%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{k \cdot \left(k \cdot t\right)}{\ell}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      2. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(k \cdot \frac{k \cdot t}{\ell}\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{k \cdot t}{\ell} \cdot k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\frac{k \cdot t}{\ell}\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      5. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(k \cdot \frac{t}{\ell}\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(k \cdot \frac{1}{\frac{\ell}{t}}\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\frac{k}{\frac{\ell}{t}}\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \left(\frac{\ell}{t}\right)\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
      9. /-lowering-/.f6450.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, t\right)\right), k\right)\right)\right), \mathsf{\_.f64}\left(0, \ell\right)\right)\right) \]
    9. Applied egg-rr50.3%

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \color{blue}{\frac{k}{\frac{\ell}{t}} \cdot k}\right)}{0 - \ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.1%

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

Alternative 11: 74.8% accurate, 19.1× speedup?

\[\begin{array}{l} k_m = \left|k\right| \\ \begin{array}{l} \mathbf{if}\;k\_m \leq 4000000000:\\ \;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot -2}{k\_m \cdot \left(\frac{k\_m \cdot k\_m}{\frac{\ell}{t}} \cdot \left(0 - k\_m\right)\right)}\\ \end{array} \end{array} \]
k_m = (fabs.f64 k)
(FPCore (t l k_m)
 :precision binary64
 (if (<= k_m 4000000000.0)
   (/ (/ (/ -2.0 (/ k_m l)) k_m) (/ k_m (- 0.0 (/ l (* k_m t)))))
   (/ (* l -2.0) (* k_m (* (/ (* k_m k_m) (/ l t)) (- 0.0 k_m))))))
k_m = fabs(k);
double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 4000000000.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = (l * -2.0) / (k_m * (((k_m * k_m) / (l / t)) * (0.0 - k_m)));
	}
	return tmp;
}
k_m = abs(k)
real(8) function code(t, l, k_m)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k_m
    real(8) :: tmp
    if (k_m <= 4000000000.0d0) then
        tmp = (((-2.0d0) / (k_m / l)) / k_m) / (k_m / (0.0d0 - (l / (k_m * t))))
    else
        tmp = (l * (-2.0d0)) / (k_m * (((k_m * k_m) / (l / t)) * (0.0d0 - k_m)))
    end if
    code = tmp
end function
k_m = Math.abs(k);
public static double code(double t, double l, double k_m) {
	double tmp;
	if (k_m <= 4000000000.0) {
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	} else {
		tmp = (l * -2.0) / (k_m * (((k_m * k_m) / (l / t)) * (0.0 - k_m)));
	}
	return tmp;
}
k_m = math.fabs(k)
def code(t, l, k_m):
	tmp = 0
	if k_m <= 4000000000.0:
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))))
	else:
		tmp = (l * -2.0) / (k_m * (((k_m * k_m) / (l / t)) * (0.0 - k_m)))
	return tmp
k_m = abs(k)
function code(t, l, k_m)
	tmp = 0.0
	if (k_m <= 4000000000.0)
		tmp = Float64(Float64(Float64(-2.0 / Float64(k_m / l)) / k_m) / Float64(k_m / Float64(0.0 - Float64(l / Float64(k_m * t)))));
	else
		tmp = Float64(Float64(l * -2.0) / Float64(k_m * Float64(Float64(Float64(k_m * k_m) / Float64(l / t)) * Float64(0.0 - k_m))));
	end
	return tmp
end
k_m = abs(k);
function tmp_2 = code(t, l, k_m)
	tmp = 0.0;
	if (k_m <= 4000000000.0)
		tmp = ((-2.0 / (k_m / l)) / k_m) / (k_m / (0.0 - (l / (k_m * t))));
	else
		tmp = (l * -2.0) / (k_m * (((k_m * k_m) / (l / t)) * (0.0 - k_m)));
	end
	tmp_2 = tmp;
end
k_m = N[Abs[k], $MachinePrecision]
code[t_, l_, k$95$m_] := If[LessEqual[k$95$m, 4000000000.0], N[(N[(N[(-2.0 / N[(k$95$m / l), $MachinePrecision]), $MachinePrecision] / k$95$m), $MachinePrecision] / N[(k$95$m / N[(0.0 - N[(l / N[(k$95$m * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * -2.0), $MachinePrecision] / N[(k$95$m * N[(N[(N[(k$95$m * k$95$m), $MachinePrecision] / N[(l / t), $MachinePrecision]), $MachinePrecision] * N[(0.0 - k$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
k_m = \left|k\right|

\\
\begin{array}{l}
\mathbf{if}\;k\_m \leq 4000000000:\\
\;\;\;\;\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}\\

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


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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6460.5%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified60.5%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6458.0%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr58.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. distribute-frac-neg2N/A

        \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
      3. distribute-frac-negN/A

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

        \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
    9. Applied egg-rr80.2%

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

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

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
      4. metadata-evalN/A

        \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
      5. distribute-rgt-neg-inN/A

        \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      6. sub0-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
      12. sub0-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
      13. remove-double-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
    11. Applied egg-rr82.9%

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

    if 4e9 < k

    1. Initial program 24.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 \mathsf{/.f64}\left(2, \color{blue}{\left(\frac{{k}^{4} \cdot t}{{\ell}^{2}}\right)}\right) \]
    4. Step-by-step derivation
      1. associate-/l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6443.6%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified43.6%

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
      2. associate-*l*N/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
      4. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
      5. frac-2negN/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      10. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
      16. --lowering--.f6449.3%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
    7. Applied egg-rr49.3%

      \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
      2. associate-/r/N/A

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

        \[\leadsto \frac{2 \cdot \left(\mathsf{neg}\left(\ell\right)\right)}{\color{blue}{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\left(k \cdot k\right)} \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(2 \cdot \ell\right)\right), \color{blue}{\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\ell \cdot 2\right)\right), \left(\left(\color{blue}{k} \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right) \]
      7. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\ell \cdot \left(\mathsf{neg}\left(2\right)\right)\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(\mathsf{neg}\left(2\right)\right)\right), \left(\color{blue}{\left(k \cdot k\right)} \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \left(\left(k \cdot \color{blue}{k}\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \left(k \cdot \color{blue}{\left(k \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{\left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}\right)\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}\right)\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \color{blue}{\ell}\right)\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(t \cdot \left(k \cdot k\right)\right), \ell\right)\right)\right)\right)\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \left(k \cdot k\right)\right), \ell\right)\right)\right)\right)\right) \]
      17. *-lowering-*.f6449.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(k, k\right)\right), \ell\right)\right)\right)\right)\right) \]
    9. Applied egg-rr49.3%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right)\right)\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{t}{\ell}}\right)\right)\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \left(\left(k \cdot k\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{t}}}\right)\right)\right)\right)\right) \]
      4. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \left(\frac{k \cdot k}{\color{blue}{\frac{\ell}{t}}}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(k \cdot k\right), \color{blue}{\left(\frac{\ell}{t}\right)}\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\frac{\color{blue}{\ell}}{t}\right)\right)\right)\right)\right)\right) \]
      7. /-lowering-/.f6450.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, -2\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{/.f64}\left(\ell, \color{blue}{t}\right)\right)\right)\right)\right)\right) \]
    11. Applied egg-rr50.9%

      \[\leadsto \frac{\ell \cdot -2}{k \cdot \left(k \cdot \left(0 - \color{blue}{\frac{k \cdot k}{\frac{\ell}{t}}}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification74.1%

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

Alternative 12: 74.8% accurate, 24.8× speedup?

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

\\
\frac{\frac{\frac{-2}{\frac{k\_m}{\ell}}}{k\_m}}{\frac{k\_m}{0 - \frac{\ell}{k\_m \cdot t}}}
\end{array}
Derivation
  1. Initial program 35.7%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    4. pow-sqrN/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
    12. *-lowering-*.f6456.4%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
  5. Simplified56.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
    2. associate-*l*N/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
    5. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    10. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    11. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
    16. --lowering--.f6456.0%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
  7. Applied egg-rr56.0%

    \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
    2. distribute-frac-neg2N/A

      \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
    3. distribute-frac-negN/A

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

      \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
  9. Applied egg-rr72.1%

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

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

      \[\leadsto \frac{\mathsf{neg}\left(2 \cdot \ell\right)}{\color{blue}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
    3. distribute-lft-neg-inN/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(2\right)\right) \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right) \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
    4. metadata-evalN/A

      \[\leadsto \frac{-2 \cdot \ell}{\mathsf{neg}\left(\color{blue}{\left(k \cdot k\right)} \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)} \]
    5. distribute-rgt-neg-inN/A

      \[\leadsto \frac{-2 \cdot \ell}{\left(k \cdot k\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
    6. sub0-negN/A

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

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

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

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

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

      \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\color{blue}{\mathsf{neg}\left(\left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
    12. sub0-negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)\right)} \]
    13. remove-double-negN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{\ell \cdot -2}{k}}{k}\right)\right), \color{blue}{\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right) \]
  11. Applied egg-rr74.1%

    \[\leadsto \color{blue}{\frac{-\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{\frac{\ell}{k \cdot t}}}} \]
  12. Final simplification74.1%

    \[\leadsto \frac{\frac{\frac{-2}{\frac{k}{\ell}}}{k}}{\frac{k}{0 - \frac{\ell}{k \cdot t}}} \]
  13. Add Preprocessing

Alternative 13: 73.2% accurate, 28.1× speedup?

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

\\
\frac{\ell}{k\_m} \cdot \frac{2}{\frac{k\_m \cdot t}{\frac{\ell}{k\_m \cdot k\_m}}}
\end{array}
Derivation
  1. Initial program 35.7%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    4. pow-sqrN/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
    12. *-lowering-*.f6456.4%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
  5. Simplified56.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
    2. associate-*l*N/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
    5. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    10. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    11. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
    16. --lowering--.f6456.0%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
  7. Applied egg-rr56.0%

    \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
    2. distribute-frac-neg2N/A

      \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
    3. distribute-frac-negN/A

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

      \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
  9. Applied egg-rr72.1%

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

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

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

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

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

      \[\leadsto \frac{\ell}{k} \cdot \frac{\mathsf{neg}\left(2\right)}{\color{blue}{\mathsf{neg}\left(k \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\ell}{k} \cdot \frac{-2}{\mathsf{neg}\left(\color{blue}{k \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}\right)} \]
    7. distribute-rgt-neg-outN/A

      \[\leadsto \frac{\ell}{k} \cdot \frac{-2}{k \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}} \]
    8. sub0-negN/A

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

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{-2}{k \cdot \left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right)}\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{-2}}{k \cdot \left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right)\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\mathsf{neg}\left(2\right)}{\color{blue}{k} \cdot \left(0 - \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right)\right) \]
    12. sub0-negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\mathsf{neg}\left(2\right)}{k \cdot \left(\mathsf{neg}\left(\frac{t \cdot \left(k \cdot k\right)}{\ell}\right)\right)}\right)\right) \]
    13. distribute-rgt-neg-outN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\mathsf{neg}\left(2\right)}{\mathsf{neg}\left(k \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right)\right) \]
    14. frac-2negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{2}{\color{blue}{k \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}}}\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(2, \color{blue}{\left(k \cdot \frac{t \cdot \left(k \cdot k\right)}{\ell}\right)}\right)\right) \]
    16. associate-/l*N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(2, \left(\left(k \cdot t\right) \cdot \color{blue}{\frac{k \cdot k}{\ell}}\right)\right)\right) \]
    18. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(2, \left(\left(k \cdot t\right) \cdot \frac{1}{\color{blue}{\frac{\ell}{k \cdot k}}}\right)\right)\right) \]
  11. Applied egg-rr73.6%

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

Alternative 14: 72.4% accurate, 28.1× speedup?

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

\\
\ell \cdot \frac{2}{\left(k\_m \cdot k\_m\right) \cdot \left(t \cdot \left(k\_m \cdot \frac{k\_m}{\ell}\right)\right)}
\end{array}
Derivation
  1. Initial program 35.7%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    4. pow-sqrN/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
    12. *-lowering-*.f6456.4%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
  5. Simplified56.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
    2. associate-*l*N/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
    5. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    10. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    11. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
    16. --lowering--.f6456.0%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
  7. Applied egg-rr56.0%

    \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
    2. distribute-frac-neg2N/A

      \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
    3. distribute-frac-negN/A

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

      \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
  9. Applied egg-rr72.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\frac{\left(t \cdot k\right) \cdot k}{\ell}\right)\right)\right), \ell\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\frac{\left(k \cdot t\right) \cdot k}{\ell}\right)\right)\right), \ell\right) \]
    3. associate-*l/N/A

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\left(t \cdot \frac{k}{\ell}\right) \cdot k\right)\right)\right), \ell\right) \]
    6. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(t \cdot \left(\frac{k}{\ell} \cdot k\right)\right)\right)\right), \ell\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, \left(\frac{k}{\ell} \cdot k\right)\right)\right)\right), \ell\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(\frac{k}{\ell}\right), k\right)\right)\right)\right), \ell\right) \]
    9. /-lowering-/.f6473.6%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \ell\right), k\right)\right)\right)\right), \ell\right) \]
  11. Applied egg-rr73.6%

    \[\leadsto \frac{2}{\left(k \cdot k\right) \cdot \color{blue}{\left(t \cdot \left(\frac{k}{\ell} \cdot k\right)\right)}} \cdot \ell \]
  12. Final simplification73.6%

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

Alternative 15: 70.9% accurate, 28.1× speedup?

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

\\
\ell \cdot \frac{2}{t \cdot \left(\frac{k\_m}{\frac{\ell}{k\_m}} \cdot \left(k\_m \cdot k\_m\right)\right)}
\end{array}
Derivation
  1. Initial program 35.7%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
    3. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    4. pow-sqrN/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
    12. *-lowering-*.f6456.4%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
  5. Simplified56.4%

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right) \cdot t}{\color{blue}{\ell \cdot \ell}}\right)\right) \]
    2. associate-*l*N/A

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

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \color{blue}{\frac{\left(k \cdot k\right) \cdot t}{\ell \cdot \ell}}\right)\right) \]
    4. associate-/l/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\frac{\left(k \cdot k\right) \cdot t}{\ell}}{\color{blue}{\ell}}\right)\right) \]
    5. frac-2negN/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \frac{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    6. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(2, \left(\frac{\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    10. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    11. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \left(\frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\left(\left(k \cdot k\right) \cdot t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(\mathsf{neg}\left(\ell\right)\right)\right)\right) \]
    15. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \left(0 - \color{blue}{\ell}\right)\right)\right) \]
    16. --lowering--.f6456.0%

      \[\leadsto \mathsf{/.f64}\left(2, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), t\right), \ell\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{\ell}\right)\right)\right) \]
  7. Applied egg-rr56.0%

    \[\leadsto \frac{2}{\color{blue}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{0 - \ell}}} \]
  8. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \frac{2}{\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\mathsf{neg}\left(\ell\right)}} \]
    2. distribute-frac-neg2N/A

      \[\leadsto \frac{2}{\mathsf{neg}\left(\frac{\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)}{\ell}\right)} \]
    3. distribute-frac-negN/A

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

      \[\leadsto \frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)} \cdot \color{blue}{\ell} \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{\mathsf{neg}\left(\left(k \cdot k\right) \cdot \left(0 - \frac{\left(k \cdot k\right) \cdot t}{\ell}\right)\right)}\right), \color{blue}{\ell}\right) \]
  9. Applied egg-rr72.1%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \left(\frac{t \cdot \left(k \cdot k\right)}{\ell} \cdot \left(k \cdot k\right)\right)\right), \ell\right) \]
    2. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \left(\left(t \cdot \frac{k \cdot k}{\ell}\right) \cdot \left(k \cdot k\right)\right)\right), \ell\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \left(t \cdot \left(\frac{k \cdot k}{\ell} \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \left(\frac{k \cdot k}{\ell} \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(\frac{k \cdot k}{\ell}\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    6. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(k \cdot \frac{k}{\ell}\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(k \cdot \frac{1}{\frac{\ell}{k}}\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    8. un-div-invN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\left(\frac{k}{\frac{\ell}{k}}\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \left(\frac{\ell}{k}\right)\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, k\right)\right), \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
    11. *-lowering-*.f6471.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(t, \mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\ell, k\right)\right), \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \ell\right) \]
  11. Applied egg-rr71.4%

    \[\leadsto \frac{2}{\color{blue}{t \cdot \left(\frac{k}{\frac{\ell}{k}} \cdot \left(k \cdot k\right)\right)}} \cdot \ell \]
  12. Final simplification71.4%

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

Reproduce

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