Toniolo and Linder, Equation (10-)

Percentage Accurate: 34.8% → 95.4%
Time: 18.2s
Alternatives: 24
Speedup: 11.0×

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 24 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: 34.8% 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} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_m \leq 5.6 \cdot 10^{+61}:\\ \;\;\;\;\frac{2 \cdot \ell}{t\_m \cdot k} \cdot \frac{\ell \cdot \frac{1}{\sin k \cdot \tan k}}{k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot \ell}{t\_m \cdot {\sin k}^{2}} \cdot \frac{\ell \cdot \cos k}{k \cdot k}\\ \end{array} \end{array} \]
t\_m = (fabs.f64 t)
t\_s = (copysign.f64 #s(literal 1 binary64) t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 5.6e+61)
    (* (/ (* 2.0 l) (* t_m k)) (/ (* l (/ 1.0 (* (sin k) (tan k)))) k))
    (* (/ (* 2.0 l) (* t_m (pow (sin k) 2.0))) (/ (* l (cos k)) (* k k))))))
t\_m = fabs(t);
t\_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 5.6e+61) {
		tmp = ((2.0 * l) / (t_m * k)) * ((l * (1.0 / (sin(k) * tan(k)))) / k);
	} else {
		tmp = ((2.0 * l) / (t_m * pow(sin(k), 2.0))) * ((l * cos(k)) / (k * k));
	}
	return t_s * tmp;
}
t\_m = abs(t)
t\_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (t_m <= 5.6d+61) then
        tmp = ((2.0d0 * l) / (t_m * k)) * ((l * (1.0d0 / (sin(k) * tan(k)))) / k)
    else
        tmp = ((2.0d0 * l) / (t_m * (sin(k) ** 2.0d0))) * ((l * cos(k)) / (k * k))
    end if
    code = t_s * tmp
end function
t\_m = Math.abs(t);
t\_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (t_m <= 5.6e+61) {
		tmp = ((2.0 * l) / (t_m * k)) * ((l * (1.0 / (Math.sin(k) * Math.tan(k)))) / k);
	} else {
		tmp = ((2.0 * l) / (t_m * Math.pow(Math.sin(k), 2.0))) * ((l * Math.cos(k)) / (k * k));
	}
	return t_s * tmp;
}
t\_m = math.fabs(t)
t\_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if t_m <= 5.6e+61:
		tmp = ((2.0 * l) / (t_m * k)) * ((l * (1.0 / (math.sin(k) * math.tan(k)))) / k)
	else:
		tmp = ((2.0 * l) / (t_m * math.pow(math.sin(k), 2.0))) * ((l * math.cos(k)) / (k * k))
	return t_s * tmp
t\_m = abs(t)
t\_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (t_m <= 5.6e+61)
		tmp = Float64(Float64(Float64(2.0 * l) / Float64(t_m * k)) * Float64(Float64(l * Float64(1.0 / Float64(sin(k) * tan(k)))) / k));
	else
		tmp = Float64(Float64(Float64(2.0 * l) / Float64(t_m * (sin(k) ^ 2.0))) * Float64(Float64(l * cos(k)) / Float64(k * k)));
	end
	return Float64(t_s * tmp)
end
t\_m = abs(t);
t\_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (t_m <= 5.6e+61)
		tmp = ((2.0 * l) / (t_m * k)) * ((l * (1.0 / (sin(k) * tan(k)))) / k);
	else
		tmp = ((2.0 * l) / (t_m * (sin(k) ^ 2.0))) * ((l * cos(k)) / (k * k));
	end
	tmp_2 = t_s * tmp;
end
t\_m = N[Abs[t], $MachinePrecision]
t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[t$95$m, 5.6e+61], N[(N[(N[(2.0 * l), $MachinePrecision] / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[(1.0 / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] / N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
t\_m = \left|t\right|
\\
t\_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_m \leq 5.6 \cdot 10^{+61}:\\
\;\;\;\;\frac{2 \cdot \ell}{t\_m \cdot k} \cdot \frac{\ell \cdot \frac{1}{\sin k \cdot \tan k}}{k}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.6000000000000003e61

    1. Initial program 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{2 \cdot \ell}{t \cdot {\sin k}^{2}} \cdot \frac{\ell \cdot \cos k}{k \cdot k} \]
        2. Applied rewrites98.5%

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

        if 5.6000000000000003e61 < t

        1. Initial program 18.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 2: 82.7% accurate, 1.7× speedup?

          \[\begin{array}{l} t\_m = \left|t\right| \\ t\_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := t\_m \cdot \mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right)\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;k \leq 9 \cdot 10^{-5}:\\ \;\;\;\;{\left(\frac{k \cdot k}{2 \cdot \ell}\right)}^{-1} \cdot {\left(\frac{k}{\frac{\ell}{t\_m \cdot k}}\right)}^{-1}\\ \mathbf{elif}\;k \leq 3 \cdot 10^{+147}:\\ \;\;\;\;\left(\ell \cdot \frac{2 \cdot \ell}{t\_2}\right) \cdot \frac{\cos k}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(2 \cdot \ell\right) \cdot \frac{\ell \cdot \cos k}{k}}{k \cdot t\_2}\\ \end{array} \end{array} \end{array} \]
          t\_m = (fabs.f64 t)
          t\_s = (copysign.f64 #s(literal 1 binary64) t)
          (FPCore (t_s t_m l k)
           :precision binary64
           (let* ((t_2 (* t_m (fma (cos (+ k k)) -0.5 0.5))))
             (*
              t_s
              (if (<= k 9e-5)
                (* (pow (/ (* k k) (* 2.0 l)) -1.0) (pow (/ k (/ l (* t_m k))) -1.0))
                (if (<= k 3e+147)
                  (* (* l (/ (* 2.0 l) t_2)) (/ (cos k) (* k k)))
                  (/ (* (* 2.0 l) (/ (* l (cos k)) k)) (* k t_2)))))))
          t\_m = fabs(t);
          t\_s = copysign(1.0, t);
          double code(double t_s, double t_m, double l, double k) {
          	double t_2 = t_m * fma(cos((k + k)), -0.5, 0.5);
          	double tmp;
          	if (k <= 9e-5) {
          		tmp = pow(((k * k) / (2.0 * l)), -1.0) * pow((k / (l / (t_m * k))), -1.0);
          	} else if (k <= 3e+147) {
          		tmp = (l * ((2.0 * l) / t_2)) * (cos(k) / (k * k));
          	} else {
          		tmp = ((2.0 * l) * ((l * cos(k)) / k)) / (k * t_2);
          	}
          	return t_s * tmp;
          }
          
          t\_m = abs(t)
          t\_s = copysign(1.0, t)
          function code(t_s, t_m, l, k)
          	t_2 = Float64(t_m * fma(cos(Float64(k + k)), -0.5, 0.5))
          	tmp = 0.0
          	if (k <= 9e-5)
          		tmp = Float64((Float64(Float64(k * k) / Float64(2.0 * l)) ^ -1.0) * (Float64(k / Float64(l / Float64(t_m * k))) ^ -1.0));
          	elseif (k <= 3e+147)
          		tmp = Float64(Float64(l * Float64(Float64(2.0 * l) / t_2)) * Float64(cos(k) / Float64(k * k)));
          	else
          		tmp = Float64(Float64(Float64(2.0 * l) * Float64(Float64(l * cos(k)) / k)) / Float64(k * t_2));
          	end
          	return Float64(t_s * tmp)
          end
          
          t\_m = N[Abs[t], $MachinePrecision]
          t\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[t$95$s_, t$95$m_, l_, k_] := Block[{t$95$2 = N[(t$95$m * N[(N[Cos[N[(k + k), $MachinePrecision]], $MachinePrecision] * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[k, 9e-5], N[(N[Power[N[(N[(k * k), $MachinePrecision] / N[(2.0 * l), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[Power[N[(k / N[(l / N[(t$95$m * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3e+147], N[(N[(l * N[(N[(2.0 * l), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * l), $MachinePrecision] * N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision] / N[(k * t$95$2), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
          
          \begin{array}{l}
          t\_m = \left|t\right|
          \\
          t\_s = \mathsf{copysign}\left(1, t\right)
          
          \\
          \begin{array}{l}
          t_2 := t\_m \cdot \mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right)\\
          t\_s \cdot \begin{array}{l}
          \mathbf{if}\;k \leq 9 \cdot 10^{-5}:\\
          \;\;\;\;{\left(\frac{k \cdot k}{2 \cdot \ell}\right)}^{-1} \cdot {\left(\frac{k}{\frac{\ell}{t\_m \cdot k}}\right)}^{-1}\\
          
          \mathbf{elif}\;k \leq 3 \cdot 10^{+147}:\\
          \;\;\;\;\left(\ell \cdot \frac{2 \cdot \ell}{t\_2}\right) \cdot \frac{\cos k}{k \cdot k}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\left(2 \cdot \ell\right) \cdot \frac{\ell \cdot \cos k}{k}}{k \cdot t\_2}\\
          
          
          \end{array}
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if k < 9.00000000000000057e-5

            1. Initial program 36.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{2 \cdot \left(\ell \cdot \ell\right)}{t \cdot \left(\left(k \cdot k\right) \cdot \color{blue}{\left(k \cdot k\right)}\right)} \]
              14. lower-*.f6466.2

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

              \[\leadsto \color{blue}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{t \cdot \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)}} \]
            6. Step-by-step derivation
              1. Applied rewrites73.7%

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

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

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

                  if 9.00000000000000057e-5 < k < 2.99999999999999993e147

                  1. Initial program 22.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 2.99999999999999993e147 < k

                      1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 9 \cdot 10^{-5}:\\ \;\;\;\;{\left(\frac{k \cdot k}{2 \cdot \ell}\right)}^{-1} \cdot {\left(\frac{k}{\frac{\ell}{t \cdot k}}\right)}^{-1}\\ \mathbf{elif}\;k \leq 3 \cdot 10^{+147}:\\ \;\;\;\;\left(\ell \cdot \frac{2 \cdot \ell}{t \cdot \mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right)}\right) \cdot \frac{\cos k}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(2 \cdot \ell\right) \cdot \frac{\ell \cdot \cos k}{k}}{k \cdot \left(t \cdot \mathsf{fma}\left(\cos \left(k + k\right), -0.5, 0.5\right)\right)}\\ \end{array} \]
                        5. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2024227 
                        (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))))