Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.8% → 82.2%
Time: 17.7s
Alternatives: 20
Speedup: 12.5×

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 20 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: 54.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: 82.2% 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 2.8 \cdot 10^{-74}:\\ \;\;\;\;\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t\_m \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(t\_m \cdot \left(t\_m \cdot t\_m\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \cos k}{t\_m} \cdot \frac{\ell}{{\left(t\_m \cdot \sin k\right)}^{2}}\\ \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 2.8e-74)
    (* (* 2.0 (* l l)) (/ (cos k) (* (pow (sin k) 2.0) (* t_m (* k k)))))
    (if (<= t_m 5.8e+102)
      (/
       2.0
       (/
        (*
         (* (* t_m (* t_m t_m)) (/ (sin k) l))
         (* (tan k) (fma k (/ k (* t_m t_m)) 2.0)))
        l))
      (* (/ (* l (cos k)) t_m) (/ l (pow (* t_m (sin k)) 2.0)))))))
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 <= 2.8e-74) {
		tmp = (2.0 * (l * l)) * (cos(k) / (pow(sin(k), 2.0) * (t_m * (k * k))));
	} else if (t_m <= 5.8e+102) {
		tmp = 2.0 / ((((t_m * (t_m * t_m)) * (sin(k) / l)) * (tan(k) * fma(k, (k / (t_m * t_m)), 2.0))) / l);
	} else {
		tmp = ((l * cos(k)) / t_m) * (l / pow((t_m * sin(k)), 2.0));
	}
	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 <= 2.8e-74)
		tmp = Float64(Float64(2.0 * Float64(l * l)) * Float64(cos(k) / Float64((sin(k) ^ 2.0) * Float64(t_m * Float64(k * k)))));
	elseif (t_m <= 5.8e+102)
		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * Float64(t_m * t_m)) * Float64(sin(k) / l)) * Float64(tan(k) * fma(k, Float64(k / Float64(t_m * t_m)), 2.0))) / l));
	else
		tmp = Float64(Float64(Float64(l * cos(k)) / t_m) * Float64(l / (Float64(t_m * sin(k)) ^ 2.0)));
	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_] := N[(t$95$s * If[LessEqual[t$95$m, 2.8e-74], N[(N[(2.0 * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.8e+102], N[(2.0 / N[(N[(N[(N[(t$95$m * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / N[Power[N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $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 2.8 \cdot 10^{-74}:\\
\;\;\;\;\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 2.79999999999999988e-74

    1. Initial program 36.7%

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

        \[\leadsto \frac{2}{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \frac{2}{\color{blue}{\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)} \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{t}^{1.5} \cdot \left(\frac{{t}^{1.5}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{k \cdot k}{t \cdot t}\right)\right)\right)\right)}} \]
    5. 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)}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.79999999999999988e-74 < t < 5.8000000000000005e102

    1. Initial program 76.7%

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

        \[\leadsto \frac{2}{\color{blue}{\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. lift-*.f64N/A

        \[\leadsto \frac{2}{\color{blue}{\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)} \]
      3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot t\right) \cdot \left(\frac{t}{\ell \cdot \ell} \cdot \left(\sin k \cdot \left(\tan k \cdot \left(2 + \frac{k \cdot k}{t \cdot t}\right)\right)\right)\right)}} \]
    5. Applied rewrites93.0%

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

    if 5.8000000000000005e102 < t

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.8 \cdot 10^{-74}:\\ \;\;\;\;\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\cos k}{{\sin k}^{2} \cdot \left(t \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(k, \frac{k}{t \cdot t}, 2\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \cos k}{t} \cdot \frac{\ell}{{\left(t \cdot \sin k\right)}^{2}}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 2: 82.2% 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 2.8 \cdot 10^{-74}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \cos k}{{\sin k}^{2} \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t\_m \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(t\_m \cdot \left(t\_m \cdot t\_m\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \cos k}{t\_m} \cdot \frac{\ell}{{\left(t\_m \cdot \sin k\right)}^{2}}\\ \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 2.8e-74)
          (/ (* (* 2.0 (* l l)) (cos k)) (* (pow (sin k) 2.0) (* t_m (* k k))))
          (if (<= t_m 5.8e+102)
            (/
             2.0
             (/
              (*
               (* (* t_m (* t_m t_m)) (/ (sin k) l))
               (* (tan k) (fma k (/ k (* t_m t_m)) 2.0)))
              l))
            (* (/ (* l (cos k)) t_m) (/ l (pow (* t_m (sin k)) 2.0)))))))
      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 <= 2.8e-74) {
      		tmp = ((2.0 * (l * l)) * cos(k)) / (pow(sin(k), 2.0) * (t_m * (k * k)));
      	} else if (t_m <= 5.8e+102) {
      		tmp = 2.0 / ((((t_m * (t_m * t_m)) * (sin(k) / l)) * (tan(k) * fma(k, (k / (t_m * t_m)), 2.0))) / l);
      	} else {
      		tmp = ((l * cos(k)) / t_m) * (l / pow((t_m * sin(k)), 2.0));
      	}
      	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 <= 2.8e-74)
      		tmp = Float64(Float64(Float64(2.0 * Float64(l * l)) * cos(k)) / Float64((sin(k) ^ 2.0) * Float64(t_m * Float64(k * k))));
      	elseif (t_m <= 5.8e+102)
      		tmp = Float64(2.0 / Float64(Float64(Float64(Float64(t_m * Float64(t_m * t_m)) * Float64(sin(k) / l)) * Float64(tan(k) * fma(k, Float64(k / Float64(t_m * t_m)), 2.0))) / l));
      	else
      		tmp = Float64(Float64(Float64(l * cos(k)) / t_m) * Float64(l / (Float64(t_m * sin(k)) ^ 2.0)));
      	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_] := N[(t$95$s * If[LessEqual[t$95$m, 2.8e-74], N[(N[(N[(2.0 * N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 5.8e+102], N[(2.0 / N[(N[(N[(N[(t$95$m * N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[(k * N[(k / N[(t$95$m * t$95$m), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(N[(l * N[Cos[k], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision] * N[(l / N[Power[N[(t$95$m * N[Sin[k], $MachinePrecision]), $MachinePrecision], 2.0], $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 2.8 \cdot 10^{-74}:\\
      \;\;\;\;\frac{\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \cos k}{{\sin k}^{2} \cdot \left(t\_m \cdot \left(k \cdot k\right)\right)}\\
      
      \mathbf{elif}\;t\_m \leq 5.8 \cdot 10^{+102}:\\
      \;\;\;\;\frac{2}{\frac{\left(\left(t\_m \cdot \left(t\_m \cdot t\_m\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(k, \frac{k}{t\_m \cdot t\_m}, 2\right)\right)}{\ell}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\ell \cdot \cos k}{t\_m} \cdot \frac{\ell}{{\left(t\_m \cdot \sin k\right)}^{2}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < 2.79999999999999988e-74

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.79999999999999988e-74 < t < 5.8000000000000005e102

        1. Initial program 74.9%

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

            \[\leadsto \frac{2}{\color{blue}{\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. lift-*.f64N/A

            \[\leadsto \frac{2}{\color{blue}{\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)} \]
          3. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 5.8000000000000005e102 < t

        1. Initial program 60.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 2.8 \cdot 10^{-74}:\\ \;\;\;\;\frac{\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \cos k}{{\sin k}^{2} \cdot \left(t \cdot \left(k \cdot k\right)\right)}\\ \mathbf{elif}\;t \leq 5.8 \cdot 10^{+102}:\\ \;\;\;\;\frac{2}{\frac{\left(\left(t \cdot \left(t \cdot t\right)\right) \cdot \frac{\sin k}{\ell}\right) \cdot \left(\tan k \cdot \mathsf{fma}\left(k, \frac{k}{t \cdot t}, 2\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell \cdot \cos k}{t} \cdot \frac{\ell}{{\left(t \cdot \sin k\right)}^{2}}\\ \end{array} \]
          5. Add Preprocessing

          Reproduce

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