Toniolo and Linder, Equation (10+)

Percentage Accurate: 54.6% → 88.2%
Time: 19.6s
Alternatives: 10
Speedup: 1.4×

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 10 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.6% 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: 88.2% accurate, 0.8× 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 7.5 \cdot 10^{+19}:\\ \;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\ \mathbf{elif}\;t_m \leq 1.25 \cdot 10^{+103}:\\ \;\;\;\;\left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t_m}^{3}\right)}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t_m}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t_m}}{{\left(\sqrt[3]{k}\right)}^{2}}\right)}^{3}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 7.5e+19)
    (* 2.0 (* (pow (* (/ k l) (sin k)) -2.0) (/ 1.0 (/ t_m (cos k)))))
    (if (<= t_m 1.25e+103)
      (*
       (* l (/ 2.0 (* (tan k) (* (sin k) (pow t_m 3.0)))))
       (/ l (+ 2.0 (pow (/ k t_m) 2.0))))
      (pow (/ (/ (pow (cbrt l) 2.0) t_m) (pow (cbrt k) 2.0)) 3.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 <= 7.5e+19) {
		tmp = 2.0 * (pow(((k / l) * sin(k)), -2.0) * (1.0 / (t_m / cos(k))));
	} else if (t_m <= 1.25e+103) {
		tmp = (l * (2.0 / (tan(k) * (sin(k) * pow(t_m, 3.0))))) * (l / (2.0 + pow((k / t_m), 2.0)));
	} else {
		tmp = pow(((pow(cbrt(l), 2.0) / t_m) / pow(cbrt(k), 2.0)), 3.0);
	}
	return t_s * tmp;
}
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 <= 7.5e+19) {
		tmp = 2.0 * (Math.pow(((k / l) * Math.sin(k)), -2.0) * (1.0 / (t_m / Math.cos(k))));
	} else if (t_m <= 1.25e+103) {
		tmp = (l * (2.0 / (Math.tan(k) * (Math.sin(k) * Math.pow(t_m, 3.0))))) * (l / (2.0 + Math.pow((k / t_m), 2.0)));
	} else {
		tmp = Math.pow(((Math.pow(Math.cbrt(l), 2.0) / t_m) / Math.pow(Math.cbrt(k), 2.0)), 3.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 <= 7.5e+19)
		tmp = Float64(2.0 * Float64((Float64(Float64(k / l) * sin(k)) ^ -2.0) * Float64(1.0 / Float64(t_m / cos(k)))));
	elseif (t_m <= 1.25e+103)
		tmp = Float64(Float64(l * Float64(2.0 / Float64(tan(k) * Float64(sin(k) * (t_m ^ 3.0))))) * Float64(l / Float64(2.0 + (Float64(k / t_m) ^ 2.0))));
	else
		tmp = Float64(Float64((cbrt(l) ^ 2.0) / t_m) / (cbrt(k) ^ 2.0)) ^ 3.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, 7.5e+19], N[(2.0 * N[(N[Power[N[(N[(k / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 / N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$m, 1.25e+103], N[(N[(l * N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l / N[(2.0 + N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision] / t$95$m), $MachinePrecision] / N[Power[N[Power[k, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $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 7.5 \cdot 10^{+19}:\\
\;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\

\mathbf{elif}\;t_m \leq 1.25 \cdot 10^{+103}:\\
\;\;\;\;\left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t_m}^{3}\right)}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t_m}\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;{\left(\frac{\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t_m}}{{\left(\sqrt[3]{k}\right)}^{2}}\right)}^{3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < 7.5e19

    1. Initial program 48.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. Step-by-step derivation
      1. add-sqr-sqrt20.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow220.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr19.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 37.9%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u37.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef35.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv35.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip35.0%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*33.6%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval33.6%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr33.6%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def36.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p36.8%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/38.3%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*38.2%

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

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down36.0%

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\ell} \cdot \sin k\right)}}^{-2} \cdot {\left(\sqrt{\frac{t}{\cos k}}\right)}^{-2}\right) \]
      3. pow1/236.1%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\color{blue}{\left({\left(\frac{t}{\cos k}\right)}^{0.5}\right)}}^{-2}\right) \]
      4. pow-pow77.7%

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

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

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

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

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

    if 7.5e19 < t < 1.25e103

    1. Initial program 66.8%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Simplified79.1%

      \[\leadsto \color{blue}{\frac{\frac{2}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. associate-*r*99.6%

        \[\leadsto \frac{\color{blue}{\left(\frac{2}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)} \cdot \ell\right) \cdot \ell}}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
      2. *-un-lft-identity99.6%

        \[\leadsto \frac{\left(\frac{2}{\tan k \cdot \left({t}^{3} \cdot \sin k\right)} \cdot \ell\right) \cdot \ell}{\color{blue}{1 \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}} \]
      3. times-frac99.5%

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

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

    if 1.25e103 < t

    1. Initial program 56.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. Simplified51.4%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative51.4%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified51.4%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. add-cube-cbrt51.4%

        \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}}\right) \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}}} \]
      2. pow251.4%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}}\right)}^{2}} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      3. cbrt-div51.4%

        \[\leadsto {\color{blue}{\left(\frac{\sqrt[3]{{\ell}^{2}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}}\right)}}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      4. unpow251.4%

        \[\leadsto {\left(\frac{\sqrt[3]{\color{blue}{\ell \cdot \ell}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      5. cbrt-prod51.4%

        \[\leadsto {\left(\frac{\color{blue}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      6. pow251.4%

        \[\leadsto {\left(\frac{\color{blue}{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      7. cbrt-prod51.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\color{blue}{\sqrt[3]{{t}^{3}} \cdot \sqrt[3]{{k}^{2}}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      8. unpow351.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\sqrt[3]{\color{blue}{\left(t \cdot t\right) \cdot t}} \cdot \sqrt[3]{{k}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      9. add-cbrt-cube51.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{\color{blue}{t} \cdot \sqrt[3]{{k}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      10. unpow251.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot \sqrt[3]{\color{blue}{k \cdot k}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      11. cbrt-prod51.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot \color{blue}{\left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right)}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      12. pow251.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot \color{blue}{{\left(\sqrt[3]{k}\right)}^{2}}}\right)}^{2} \cdot \sqrt[3]{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
      13. cbrt-div51.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{2} \cdot \color{blue}{\frac{\sqrt[3]{{\ell}^{2}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}}} \]
      14. unpow251.4%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{2} \cdot \frac{\sqrt[3]{\color{blue}{\ell \cdot \ell}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}} \]
      15. cbrt-prod54.2%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{2} \cdot \frac{\color{blue}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}} \]
      16. pow254.2%

        \[\leadsto {\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{2} \cdot \frac{\color{blue}{{\left(\sqrt[3]{\ell}\right)}^{2}}}{\sqrt[3]{{t}^{3} \cdot {k}^{2}}} \]
    8. Applied egg-rr90.5%

      \[\leadsto \color{blue}{{\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{2} \cdot \frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}} \]
    9. Step-by-step derivation
      1. pow-plus90.4%

        \[\leadsto \color{blue}{{\left(\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t \cdot {\left(\sqrt[3]{k}\right)}^{2}}\right)}^{\left(2 + 1\right)}} \]
      2. metadata-eval90.4%

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

        \[\leadsto {\color{blue}{\left(\frac{\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t}}{{\left(\sqrt[3]{k}\right)}^{2}}\right)}}^{3} \]
    10. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7.5 \cdot 10^{+19}:\\ \;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t}{\cos k}}\right)\\ \mathbf{elif}\;t \leq 1.25 \cdot 10^{+103}:\\ \;\;\;\;\left(\ell \cdot \frac{2}{\tan k \cdot \left(\sin k \cdot {t}^{3}\right)}\right) \cdot \frac{\ell}{2 + {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{\frac{{\left(\sqrt[3]{\ell}\right)}^{2}}{t}}{{\left(\sqrt[3]{k}\right)}^{2}}\right)}^{3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.5% accurate, 1.0× 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}\;k \leq 1.9 \cdot 10^{+14}:\\ \;\;\;\;2 \cdot {\left(\left(k \cdot \frac{{t_m}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t_m}\right)\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{1}{\frac{t_m}{\cos k}} \cdot {\left(\frac{k}{\frac{\ell}{\sin k}}\right)}^{-2}\right)\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= k 1.9e+14)
    (*
     2.0
     (pow
      (* (* k (/ (pow t_m 1.5) l)) (hypot 1.0 (hypot 1.0 (/ k t_m))))
      -2.0))
    (* 2.0 (* (/ 1.0 (/ t_m (cos k))) (pow (/ k (/ l (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 (k <= 1.9e+14) {
		tmp = 2.0 * pow(((k * (pow(t_m, 1.5) / l)) * hypot(1.0, hypot(1.0, (k / t_m)))), -2.0);
	} else {
		tmp = 2.0 * ((1.0 / (t_m / cos(k))) * pow((k / (l / sin(k))), -2.0));
	}
	return t_s * tmp;
}
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 (k <= 1.9e+14) {
		tmp = 2.0 * Math.pow(((k * (Math.pow(t_m, 1.5) / l)) * Math.hypot(1.0, Math.hypot(1.0, (k / t_m)))), -2.0);
	} else {
		tmp = 2.0 * ((1.0 / (t_m / Math.cos(k))) * Math.pow((k / (l / Math.sin(k))), -2.0));
	}
	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 k <= 1.9e+14:
		tmp = 2.0 * math.pow(((k * (math.pow(t_m, 1.5) / l)) * math.hypot(1.0, math.hypot(1.0, (k / t_m)))), -2.0)
	else:
		tmp = 2.0 * ((1.0 / (t_m / math.cos(k))) * math.pow((k / (l / math.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 (k <= 1.9e+14)
		tmp = Float64(2.0 * (Float64(Float64(k * Float64((t_m ^ 1.5) / l)) * hypot(1.0, hypot(1.0, Float64(k / t_m)))) ^ -2.0));
	else
		tmp = Float64(2.0 * Float64(Float64(1.0 / Float64(t_m / cos(k))) * (Float64(k / Float64(l / sin(k))) ^ -2.0)));
	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 (k <= 1.9e+14)
		tmp = 2.0 * (((k * ((t_m ^ 1.5) / l)) * hypot(1.0, hypot(1.0, (k / t_m)))) ^ -2.0);
	else
		tmp = 2.0 * ((1.0 / (t_m / cos(k))) * ((k / (l / sin(k))) ^ -2.0));
	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[k, 1.9e+14], N[(2.0 * N[Power[N[(N[(k * N[(N[Power[t$95$m, 1.5], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + N[Sqrt[1.0 ^ 2 + N[(k / t$95$m), $MachinePrecision] ^ 2], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(1.0 / N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(k / N[(l / N[Sin[k], $MachinePrecision]), $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}\;k \leq 1.9 \cdot 10^{+14}:\\
\;\;\;\;2 \cdot {\left(\left(k \cdot \frac{{t_m}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t_m}\right)\right)\right)}^{-2}\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(\frac{1}{\frac{t_m}{\cos k}} \cdot {\left(\frac{k}{\frac{\ell}{\sin k}}\right)}^{-2}\right)\\


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

    1. Initial program 54.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt31.3%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow231.3%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr34.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around 0 39.9%

      \[\leadsto \frac{2}{{\left(\left(\color{blue}{k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u39.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}\right)\right)} \]
      2. expm1-udef36.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}\right)} - 1} \]
      3. div-inv36.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}}\right)} - 1 \]
      4. pow-flip36.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-*l*36.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(k \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval36.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(k \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{\color{blue}{-2}}\right)} - 1 \]
    7. Applied egg-rr36.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(k \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{-2}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def39.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(k \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{-2}\right)\right)} \]
      2. expm1-log1p39.9%

        \[\leadsto \color{blue}{2 \cdot {\left(k \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)\right)}^{-2}} \]
      3. associate-*r*39.9%

        \[\leadsto 2 \cdot {\color{blue}{\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}}^{-2} \]
    9. Simplified39.9%

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

    if 1.9e14 < k

    1. Initial program 43.6%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt23.1%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow223.1%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr21.4%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 48.7%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u46.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef41.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv41.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip41.5%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*38.9%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval38.9%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr38.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def46.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p46.5%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/49.3%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*49.3%

        \[\leadsto 2 \cdot {\left(\color{blue}{\frac{k}{\frac{\ell}{\sin k}}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2} \]
    11. Simplified49.3%

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down43.0%

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\ell} \cdot \sin k\right)}}^{-2} \cdot {\left(\sqrt{\frac{t}{\cos k}}\right)}^{-2}\right) \]
      3. pow1/243.0%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\color{blue}{\left({\left(\frac{t}{\cos k}\right)}^{0.5}\right)}}^{-2}\right) \]
      4. pow-pow81.8%

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

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

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

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\frac{\ell}{\sin k}}\right)}}^{-2} \cdot {\left(\frac{t}{\cos k}\right)}^{-1}\right) \]
      3. unpow-181.9%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\frac{\ell}{\sin k}}\right)}^{-2} \cdot \color{blue}{\frac{1}{\frac{t}{\cos k}}}\right) \]
    15. Simplified81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 1.9 \cdot 10^{+14}:\\ \;\;\;\;2 \cdot {\left(\left(k \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{1}{\frac{t}{\cos k}} \cdot {\left(\frac{k}{\frac{\ell}{\sin k}}\right)}^{-2}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.6% accurate, 1.0× 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 9 \cdot 10^{+54}:\\ \;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\ell}^{2}}{{\left(t_m \cdot {\left(\sqrt[3]{k}\right)}^{2}\right)}^{3}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 9e+54)
    (* 2.0 (* (pow (* (/ k l) (sin k)) -2.0) (/ 1.0 (/ t_m (cos k)))))
    (/ (pow l 2.0) (pow (* t_m (pow (cbrt k) 2.0)) 3.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 <= 9e+54) {
		tmp = 2.0 * (pow(((k / l) * sin(k)), -2.0) * (1.0 / (t_m / cos(k))));
	} else {
		tmp = pow(l, 2.0) / pow((t_m * pow(cbrt(k), 2.0)), 3.0);
	}
	return t_s * tmp;
}
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 <= 9e+54) {
		tmp = 2.0 * (Math.pow(((k / l) * Math.sin(k)), -2.0) * (1.0 / (t_m / Math.cos(k))));
	} else {
		tmp = Math.pow(l, 2.0) / Math.pow((t_m * Math.pow(Math.cbrt(k), 2.0)), 3.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 <= 9e+54)
		tmp = Float64(2.0 * Float64((Float64(Float64(k / l) * sin(k)) ^ -2.0) * Float64(1.0 / Float64(t_m / cos(k)))));
	else
		tmp = Float64((l ^ 2.0) / (Float64(t_m * (cbrt(k) ^ 2.0)) ^ 3.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, 9e+54], N[(2.0 * N[(N[Power[N[(N[(k / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 / N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[N[(t$95$m * N[Power[N[Power[k, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $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 9 \cdot 10^{+54}:\\
\;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{2}}{{\left(t_m \cdot {\left(\sqrt[3]{k}\right)}^{2}\right)}^{3}}\\


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

    1. Initial program 50.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt22.4%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow222.4%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr21.4%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 38.8%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u38.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef35.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv35.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip35.5%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*34.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval34.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr34.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def37.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p37.7%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/39.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*39.1%

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

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down37.0%

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\ell} \cdot \sin k\right)}}^{-2} \cdot {\left(\sqrt{\frac{t}{\cos k}}\right)}^{-2}\right) \]
      3. pow1/237.0%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\color{blue}{\left({\left(\frac{t}{\cos k}\right)}^{0.5}\right)}}^{-2}\right) \]
      4. pow-pow77.3%

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

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\left(\frac{t}{\cos k}\right)}^{\color{blue}{-1}}\right) \]
    13. Applied egg-rr77.3%

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

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \color{blue}{\frac{1}{\frac{t}{\cos k}}}\right) \]
    15. Simplified77.3%

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

    if 8.99999999999999968e54 < t

    1. Initial program 55.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. Simplified50.0%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative53.0%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified53.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. add-cube-cbrt52.9%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{\left(\sqrt[3]{{t}^{3} \cdot {k}^{2}} \cdot \sqrt[3]{{t}^{3} \cdot {k}^{2}}\right) \cdot \sqrt[3]{{t}^{3} \cdot {k}^{2}}}} \]
      2. pow352.9%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{\left(\sqrt[3]{{t}^{3} \cdot {k}^{2}}\right)}^{3}}} \]
      3. cbrt-prod52.8%

        \[\leadsto \frac{{\ell}^{2}}{{\color{blue}{\left(\sqrt[3]{{t}^{3}} \cdot \sqrt[3]{{k}^{2}}\right)}}^{3}} \]
      4. unpow352.8%

        \[\leadsto \frac{{\ell}^{2}}{{\left(\sqrt[3]{\color{blue}{\left(t \cdot t\right) \cdot t}} \cdot \sqrt[3]{{k}^{2}}\right)}^{3}} \]
      5. add-cbrt-cube58.1%

        \[\leadsto \frac{{\ell}^{2}}{{\left(\color{blue}{t} \cdot \sqrt[3]{{k}^{2}}\right)}^{3}} \]
      6. unpow258.1%

        \[\leadsto \frac{{\ell}^{2}}{{\left(t \cdot \sqrt[3]{\color{blue}{k \cdot k}}\right)}^{3}} \]
      7. cbrt-prod71.0%

        \[\leadsto \frac{{\ell}^{2}}{{\left(t \cdot \color{blue}{\left(\sqrt[3]{k} \cdot \sqrt[3]{k}\right)}\right)}^{3}} \]
      8. pow271.0%

        \[\leadsto \frac{{\ell}^{2}}{{\left(t \cdot \color{blue}{{\left(\sqrt[3]{k}\right)}^{2}}\right)}^{3}} \]
    8. Applied egg-rr71.0%

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

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

Alternative 4: 76.1% 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 9.6 \cdot 10^{+54}:\\ \;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{\tan k \cdot \left(k \cdot {t_m}^{3}\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t_m}\right)}^{2}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 9.6e+54)
    (* 2.0 (* (pow (* (/ k l) (sin k)) -2.0) (/ 1.0 (/ t_m (cos k)))))
    (/
     (* (/ 2.0 (* (tan k) (* k (pow t_m 3.0)))) (* l l))
     (+ 2.0 (pow (/ k t_m) 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 <= 9.6e+54) {
		tmp = 2.0 * (pow(((k / l) * sin(k)), -2.0) * (1.0 / (t_m / cos(k))));
	} else {
		tmp = ((2.0 / (tan(k) * (k * pow(t_m, 3.0)))) * (l * l)) / (2.0 + pow((k / t_m), 2.0));
	}
	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 <= 9.6d+54) then
        tmp = 2.0d0 * ((((k / l) * sin(k)) ** (-2.0d0)) * (1.0d0 / (t_m / cos(k))))
    else
        tmp = ((2.0d0 / (tan(k) * (k * (t_m ** 3.0d0)))) * (l * l)) / (2.0d0 + ((k / t_m) ** 2.0d0))
    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 <= 9.6e+54) {
		tmp = 2.0 * (Math.pow(((k / l) * Math.sin(k)), -2.0) * (1.0 / (t_m / Math.cos(k))));
	} else {
		tmp = ((2.0 / (Math.tan(k) * (k * Math.pow(t_m, 3.0)))) * (l * l)) / (2.0 + Math.pow((k / t_m), 2.0));
	}
	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 <= 9.6e+54:
		tmp = 2.0 * (math.pow(((k / l) * math.sin(k)), -2.0) * (1.0 / (t_m / math.cos(k))))
	else:
		tmp = ((2.0 / (math.tan(k) * (k * math.pow(t_m, 3.0)))) * (l * l)) / (2.0 + math.pow((k / t_m), 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 <= 9.6e+54)
		tmp = Float64(2.0 * Float64((Float64(Float64(k / l) * sin(k)) ^ -2.0) * Float64(1.0 / Float64(t_m / cos(k)))));
	else
		tmp = Float64(Float64(Float64(2.0 / Float64(tan(k) * Float64(k * (t_m ^ 3.0)))) * Float64(l * l)) / Float64(2.0 + (Float64(k / t_m) ^ 2.0)));
	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 <= 9.6e+54)
		tmp = 2.0 * ((((k / l) * sin(k)) ^ -2.0) * (1.0 / (t_m / cos(k))));
	else
		tmp = ((2.0 / (tan(k) * (k * (t_m ^ 3.0)))) * (l * l)) / (2.0 + ((k / t_m) ^ 2.0));
	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, 9.6e+54], N[(2.0 * N[(N[Power[N[(N[(k / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 / N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / N[(N[Tan[k], $MachinePrecision] * N[(k * N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(l * l), $MachinePrecision]), $MachinePrecision] / N[(2.0 + N[Power[N[(k / t$95$m), $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 9.6 \cdot 10^{+54}:\\
\;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{\tan k \cdot \left(k \cdot {t_m}^{3}\right)} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t_m}\right)}^{2}}\\


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

    1. Initial program 50.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt22.4%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow222.4%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr21.4%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 38.8%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u38.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef35.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv35.5%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip35.5%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*34.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval34.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr34.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def37.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p37.7%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/39.1%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*39.1%

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

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down37.0%

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\ell} \cdot \sin k\right)}}^{-2} \cdot {\left(\sqrt{\frac{t}{\cos k}}\right)}^{-2}\right) \]
      3. pow1/237.0%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\color{blue}{\left({\left(\frac{t}{\cos k}\right)}^{0.5}\right)}}^{-2}\right) \]
      4. pow-pow77.3%

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

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\left(\frac{t}{\cos k}\right)}^{\color{blue}{-1}}\right) \]
    13. Applied egg-rr77.3%

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

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \color{blue}{\frac{1}{\frac{t}{\cos k}}}\right) \]
    15. Simplified77.3%

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

    if 9.59999999999999993e54 < t

    1. Initial program 55.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. Simplified60.2%

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

      \[\leadsto \frac{\frac{2}{\tan k \cdot \color{blue}{\left(k \cdot {t}^{3}\right)}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    5. Step-by-step derivation
      1. *-commutative60.0%

        \[\leadsto \frac{\frac{2}{\tan k \cdot \color{blue}{\left({t}^{3} \cdot k\right)}} \cdot \left(\ell \cdot \ell\right)}{2 + {\left(\frac{k}{t}\right)}^{2}} \]
    6. Simplified60.0%

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

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

Alternative 5: 72.6% 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 4.5 \cdot 10^{+69}:\\ \;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 4.5e+69)
    (* 2.0 (* (pow (* (/ k l) (sin k)) -2.0) (/ 1.0 (/ t_m (cos k)))))
    (* (pow l 2.0) (/ (pow t_m -3.0) (pow 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 <= 4.5e+69) {
		tmp = 2.0 * (pow(((k / l) * sin(k)), -2.0) * (1.0 / (t_m / cos(k))));
	} else {
		tmp = pow(l, 2.0) * (pow(t_m, -3.0) / pow(k, 2.0));
	}
	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 <= 4.5d+69) then
        tmp = 2.0d0 * ((((k / l) * sin(k)) ** (-2.0d0)) * (1.0d0 / (t_m / cos(k))))
    else
        tmp = (l ** 2.0d0) * ((t_m ** (-3.0d0)) / (k ** 2.0d0))
    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 <= 4.5e+69) {
		tmp = 2.0 * (Math.pow(((k / l) * Math.sin(k)), -2.0) * (1.0 / (t_m / Math.cos(k))));
	} else {
		tmp = Math.pow(l, 2.0) * (Math.pow(t_m, -3.0) / Math.pow(k, 2.0));
	}
	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 <= 4.5e+69:
		tmp = 2.0 * (math.pow(((k / l) * math.sin(k)), -2.0) * (1.0 / (t_m / math.cos(k))))
	else:
		tmp = math.pow(l, 2.0) * (math.pow(t_m, -3.0) / math.pow(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 <= 4.5e+69)
		tmp = Float64(2.0 * Float64((Float64(Float64(k / l) * sin(k)) ^ -2.0) * Float64(1.0 / Float64(t_m / cos(k)))));
	else
		tmp = Float64((l ^ 2.0) * Float64((t_m ^ -3.0) / (k ^ 2.0)));
	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 <= 4.5e+69)
		tmp = 2.0 * ((((k / l) * sin(k)) ^ -2.0) * (1.0 / (t_m / cos(k))));
	else
		tmp = (l ^ 2.0) * ((t_m ^ -3.0) / (k ^ 2.0));
	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, 4.5e+69], N[(2.0 * N[(N[Power[N[(N[(k / l), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision] * N[(1.0 / N[(t$95$m / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[t$95$m, -3.0], $MachinePrecision] / N[Power[k, 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 4.5 \cdot 10^{+69}:\\
\;\;\;\;2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \frac{1}{\frac{t_m}{\cos k}}\right)\\

\mathbf{else}:\\
\;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\


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

    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. Step-by-step derivation
      1. add-sqr-sqrt22.6%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow222.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr22.1%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 39.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u38.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef35.8%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv35.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip35.8%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*34.5%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval34.5%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr34.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def37.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p37.9%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/39.3%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*39.3%

        \[\leadsto 2 \cdot {\left(\color{blue}{\frac{k}{\frac{\ell}{\sin k}}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2} \]
    11. Simplified39.3%

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Step-by-step derivation
      1. unpow-prod-down37.2%

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

        \[\leadsto 2 \cdot \left({\color{blue}{\left(\frac{k}{\ell} \cdot \sin k\right)}}^{-2} \cdot {\left(\sqrt{\frac{t}{\cos k}}\right)}^{-2}\right) \]
      3. pow1/237.2%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\color{blue}{\left({\left(\frac{t}{\cos k}\right)}^{0.5}\right)}}^{-2}\right) \]
      4. pow-pow76.9%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \color{blue}{{\left(\frac{t}{\cos k}\right)}^{\left(0.5 \cdot -2\right)}}\right) \]
      5. metadata-eval76.9%

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot {\left(\frac{t}{\cos k}\right)}^{\color{blue}{-1}}\right) \]
    13. Applied egg-rr76.9%

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

        \[\leadsto 2 \cdot \left({\left(\frac{k}{\ell} \cdot \sin k\right)}^{-2} \cdot \color{blue}{\frac{1}{\frac{t}{\cos k}}}\right) \]
    15. Simplified76.9%

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

    if 4.4999999999999999e69 < t

    1. Initial program 56.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. Simplified50.8%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative54.0%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified54.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv53.9%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    8. Applied egg-rr53.9%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u53.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)\right)} \]
      2. expm1-udef48.9%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)} - 1} \]
      3. associate-/r*48.9%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \color{blue}{\frac{\frac{1}{{t}^{3}}}{{k}^{2}}}\right)} - 1 \]
      4. pow-flip48.9%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{\color{blue}{{t}^{\left(-3\right)}}}{{k}^{2}}\right)} - 1 \]
      5. metadata-eval48.9%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{\color{blue}{-3}}}{{k}^{2}}\right)} - 1 \]
    10. Applied egg-rr48.9%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def54.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)\right)} \]
      2. expm1-log1p54.5%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}} \]
    12. Simplified54.5%

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

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

Alternative 6: 63.0% 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.2 \cdot 10^{+21}:\\ \;\;\;\;2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{t_m}\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 5.2e+21)
    (* 2.0 (pow (* (/ k (/ l (sin k))) (sqrt t_m)) -2.0))
    (* (pow l 2.0) (/ (pow t_m -3.0) (pow 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 <= 5.2e+21) {
		tmp = 2.0 * pow(((k / (l / sin(k))) * sqrt(t_m)), -2.0);
	} else {
		tmp = pow(l, 2.0) * (pow(t_m, -3.0) / pow(k, 2.0));
	}
	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.2d+21) then
        tmp = 2.0d0 * (((k / (l / sin(k))) * sqrt(t_m)) ** (-2.0d0))
    else
        tmp = (l ** 2.0d0) * ((t_m ** (-3.0d0)) / (k ** 2.0d0))
    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.2e+21) {
		tmp = 2.0 * Math.pow(((k / (l / Math.sin(k))) * Math.sqrt(t_m)), -2.0);
	} else {
		tmp = Math.pow(l, 2.0) * (Math.pow(t_m, -3.0) / Math.pow(k, 2.0));
	}
	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.2e+21:
		tmp = 2.0 * math.pow(((k / (l / math.sin(k))) * math.sqrt(t_m)), -2.0)
	else:
		tmp = math.pow(l, 2.0) * (math.pow(t_m, -3.0) / math.pow(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 <= 5.2e+21)
		tmp = Float64(2.0 * (Float64(Float64(k / Float64(l / sin(k))) * sqrt(t_m)) ^ -2.0));
	else
		tmp = Float64((l ^ 2.0) * Float64((t_m ^ -3.0) / (k ^ 2.0)));
	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.2e+21)
		tmp = 2.0 * (((k / (l / sin(k))) * sqrt(t_m)) ^ -2.0);
	else
		tmp = (l ^ 2.0) * ((t_m ^ -3.0) / (k ^ 2.0));
	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.2e+21], N[(2.0 * N[Power[N[(N[(k / N[(l / N[Sin[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sqrt[t$95$m], $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[t$95$m, -3.0], $MachinePrecision] / N[Power[k, 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 5.2 \cdot 10^{+21}:\\
\;\;\;\;2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{t_m}\right)}^{-2}\\

\mathbf{else}:\\
\;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\


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

    1. Initial program 48.3%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.6%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow220.6%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr19.6%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 38.1%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u37.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)\right)} \]
      2. expm1-udef35.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{2}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}\right)} - 1} \]
      3. div-inv35.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{2 \cdot \frac{1}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{2}}}\right)} - 1 \]
      4. pow-flip35.2%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot \color{blue}{{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}^{\left(-2\right)}}\right)} - 1 \]
      5. associate-/l*33.8%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}}^{\left(-2\right)}\right)} - 1 \]
      6. metadata-eval33.8%

        \[\leadsto e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{\color{blue}{-2}}\right)} - 1 \]
    9. Applied egg-rr33.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)} - 1} \]
    10. Step-by-step derivation
      1. expm1-def36.4%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}\right)\right)} \]
      2. expm1-log1p36.9%

        \[\leadsto \color{blue}{2 \cdot {\left(\frac{k \cdot \sin k}{\frac{\ell}{\sqrt{\frac{t}{\cos k}}}}\right)}^{-2}} \]
      3. associate-/r/38.4%

        \[\leadsto 2 \cdot {\color{blue}{\left(\frac{k \cdot \sin k}{\ell} \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{-2} \]
      4. associate-/l*38.4%

        \[\leadsto 2 \cdot {\left(\color{blue}{\frac{k}{\frac{\ell}{\sin k}}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2} \]
    11. Simplified38.4%

      \[\leadsto \color{blue}{2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{\frac{t}{\cos k}}\right)}^{-2}} \]
    12. Taylor expanded in k around 0 25.1%

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

    if 5.2e21 < 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. Simplified55.2%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative53.6%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified53.6%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv53.6%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    8. Applied egg-rr53.6%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u53.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)\right)} \]
      2. expm1-udef49.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)} - 1} \]
      3. associate-/r*49.4%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \color{blue}{\frac{\frac{1}{{t}^{3}}}{{k}^{2}}}\right)} - 1 \]
      4. pow-flip49.4%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{\color{blue}{{t}^{\left(-3\right)}}}{{k}^{2}}\right)} - 1 \]
      5. metadata-eval49.4%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{\color{blue}{-3}}}{{k}^{2}}\right)} - 1 \]
    10. Applied egg-rr49.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def54.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)\right)} \]
      2. expm1-log1p54.1%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}} \]
    12. Simplified54.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 5.2 \cdot 10^{+21}:\\ \;\;\;\;2 \cdot {\left(\frac{k}{\frac{\ell}{\sin k}} \cdot \sqrt{t}\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 61.9% accurate, 1.4× 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 1.9 \cdot 10^{-45}:\\ \;\;\;\;\frac{2}{{\left(\sqrt{t_m} \cdot \frac{{k}^{2}}{\ell}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1.9e-45)
    (/ 2.0 (pow (* (sqrt t_m) (/ (pow k 2.0) l)) 2.0))
    (* (pow l 2.0) (/ (pow t_m -3.0) (pow 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 <= 1.9e-45) {
		tmp = 2.0 / pow((sqrt(t_m) * (pow(k, 2.0) / l)), 2.0);
	} else {
		tmp = pow(l, 2.0) * (pow(t_m, -3.0) / pow(k, 2.0));
	}
	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 <= 1.9d-45) then
        tmp = 2.0d0 / ((sqrt(t_m) * ((k ** 2.0d0) / l)) ** 2.0d0)
    else
        tmp = (l ** 2.0d0) * ((t_m ** (-3.0d0)) / (k ** 2.0d0))
    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 <= 1.9e-45) {
		tmp = 2.0 / Math.pow((Math.sqrt(t_m) * (Math.pow(k, 2.0) / l)), 2.0);
	} else {
		tmp = Math.pow(l, 2.0) * (Math.pow(t_m, -3.0) / Math.pow(k, 2.0));
	}
	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 <= 1.9e-45:
		tmp = 2.0 / math.pow((math.sqrt(t_m) * (math.pow(k, 2.0) / l)), 2.0)
	else:
		tmp = math.pow(l, 2.0) * (math.pow(t_m, -3.0) / math.pow(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 <= 1.9e-45)
		tmp = Float64(2.0 / (Float64(sqrt(t_m) * Float64((k ^ 2.0) / l)) ^ 2.0));
	else
		tmp = Float64((l ^ 2.0) * Float64((t_m ^ -3.0) / (k ^ 2.0)));
	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 <= 1.9e-45)
		tmp = 2.0 / ((sqrt(t_m) * ((k ^ 2.0) / l)) ^ 2.0);
	else
		tmp = (l ^ 2.0) * ((t_m ^ -3.0) / (k ^ 2.0));
	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, 1.9e-45], N[(2.0 / N[Power[N[(N[Sqrt[t$95$m], $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[t$95$m, -3.0], $MachinePrecision] / N[Power[k, 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 1.9 \cdot 10^{-45}:\\
\;\;\;\;\frac{2}{{\left(\sqrt{t_m} \cdot \frac{{k}^{2}}{\ell}\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\


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

    1. Initial program 47.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.4%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.4%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr17.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 36.8%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Taylor expanded in k around 0 22.2%

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

    if 1.89999999999999999e-45 < t

    1. Initial program 61.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. Simplified56.1%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative54.7%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified54.7%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv54.7%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    8. Applied egg-rr54.7%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u54.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)\right)} \]
      2. expm1-udef51.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)} - 1} \]
      3. associate-/r*51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \color{blue}{\frac{\frac{1}{{t}^{3}}}{{k}^{2}}}\right)} - 1 \]
      4. pow-flip51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{\color{blue}{{t}^{\left(-3\right)}}}{{k}^{2}}\right)} - 1 \]
      5. metadata-eval51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{\color{blue}{-3}}}{{k}^{2}}\right)} - 1 \]
    10. Applied egg-rr51.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def55.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)\right)} \]
      2. expm1-log1p55.2%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}} \]
    12. Simplified55.2%

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

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

Alternative 8: 57.4% accurate, 1.4× 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 10^{-44}:\\ \;\;\;\;2 \cdot \frac{1}{\frac{t_m}{\frac{{\ell}^{2}}{{k}^{4}}}}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\ \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (*
  t_s
  (if (<= t_m 1e-44)
    (* 2.0 (/ 1.0 (/ t_m (/ (pow l 2.0) (pow k 4.0)))))
    (* (pow l 2.0) (/ (pow t_m -3.0) (pow 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 <= 1e-44) {
		tmp = 2.0 * (1.0 / (t_m / (pow(l, 2.0) / pow(k, 4.0))));
	} else {
		tmp = pow(l, 2.0) * (pow(t_m, -3.0) / pow(k, 2.0));
	}
	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 <= 1d-44) then
        tmp = 2.0d0 * (1.0d0 / (t_m / ((l ** 2.0d0) / (k ** 4.0d0))))
    else
        tmp = (l ** 2.0d0) * ((t_m ** (-3.0d0)) / (k ** 2.0d0))
    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 <= 1e-44) {
		tmp = 2.0 * (1.0 / (t_m / (Math.pow(l, 2.0) / Math.pow(k, 4.0))));
	} else {
		tmp = Math.pow(l, 2.0) * (Math.pow(t_m, -3.0) / Math.pow(k, 2.0));
	}
	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 <= 1e-44:
		tmp = 2.0 * (1.0 / (t_m / (math.pow(l, 2.0) / math.pow(k, 4.0))))
	else:
		tmp = math.pow(l, 2.0) * (math.pow(t_m, -3.0) / math.pow(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 <= 1e-44)
		tmp = Float64(2.0 * Float64(1.0 / Float64(t_m / Float64((l ^ 2.0) / (k ^ 4.0)))));
	else
		tmp = Float64((l ^ 2.0) * Float64((t_m ^ -3.0) / (k ^ 2.0)));
	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 <= 1e-44)
		tmp = 2.0 * (1.0 / (t_m / ((l ^ 2.0) / (k ^ 4.0))));
	else
		tmp = (l ^ 2.0) * ((t_m ^ -3.0) / (k ^ 2.0));
	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, 1e-44], N[(2.0 * N[(1.0 / N[(t$95$m / N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[t$95$m, -3.0], $MachinePrecision] / N[Power[k, 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 10^{-44}:\\
\;\;\;\;2 \cdot \frac{1}{\frac{t_m}{\frac{{\ell}^{2}}{{k}^{4}}}}\\

\mathbf{else}:\\
\;\;\;\;{\ell}^{2} \cdot \frac{{t_m}^{-3}}{{k}^{2}}\\


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

    1. Initial program 47.0%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt18.4%

        \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow218.4%

        \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
    4. Applied egg-rr17.3%

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
    5. Taylor expanded in k around inf 36.8%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
    8. Taylor expanded in k around 0 57.5%

      \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
    9. Step-by-step derivation
      1. pow257.5%

        \[\leadsto 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
      2. clear-num57.5%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{{k}^{4} \cdot t}{\ell \cdot \ell}}} \]
      3. inv-pow57.5%

        \[\leadsto 2 \cdot \color{blue}{{\left(\frac{{k}^{4} \cdot t}{\ell \cdot \ell}\right)}^{-1}} \]
      4. *-commutative57.5%

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

        \[\leadsto 2 \cdot {\left(\frac{t \cdot {k}^{4}}{\color{blue}{{\ell}^{2}}}\right)}^{-1} \]
    10. Applied egg-rr57.5%

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

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
      2. associate-/l*58.1%

        \[\leadsto 2 \cdot \frac{1}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
    12. Simplified58.1%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]

    if 9.99999999999999953e-45 < t

    1. Initial program 61.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. Simplified56.1%

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

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{k}^{2} \cdot {t}^{3}}} \]
    5. Step-by-step derivation
      1. *-commutative54.7%

        \[\leadsto \frac{{\ell}^{2}}{\color{blue}{{t}^{3} \cdot {k}^{2}}} \]
    6. Simplified54.7%

      \[\leadsto \color{blue}{\frac{{\ell}^{2}}{{t}^{3} \cdot {k}^{2}}} \]
    7. Step-by-step derivation
      1. div-inv54.7%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    8. Applied egg-rr54.7%

      \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}} \]
    9. Step-by-step derivation
      1. expm1-log1p-u54.7%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)\right)} \]
      2. expm1-udef51.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{1}{{t}^{3} \cdot {k}^{2}}\right)} - 1} \]
      3. associate-/r*51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \color{blue}{\frac{\frac{1}{{t}^{3}}}{{k}^{2}}}\right)} - 1 \]
      4. pow-flip51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{\color{blue}{{t}^{\left(-3\right)}}}{{k}^{2}}\right)} - 1 \]
      5. metadata-eval51.0%

        \[\leadsto e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{\color{blue}{-3}}}{{k}^{2}}\right)} - 1 \]
    10. Applied egg-rr51.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)} - 1} \]
    11. Step-by-step derivation
      1. expm1-def55.2%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\right)\right)} \]
      2. expm1-log1p55.2%

        \[\leadsto \color{blue}{{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}} \]
    12. Simplified55.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 10^{-44}:\\ \;\;\;\;2 \cdot \frac{1}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{2} \cdot \frac{{t}^{-3}}{{k}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 52.1% accurate, 2.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \left(2 \cdot \frac{1}{\frac{t_m}{\frac{{\ell}^{2}}{{k}^{4}}}}\right) \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* 2.0 (/ 1.0 (/ t_m (/ (pow l 2.0) (pow k 4.0)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 * (1.0 / (t_m / (pow(l, 2.0) / pow(k, 4.0)))));
}
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
    code = t_s * (2.0d0 * (1.0d0 / (t_m / ((l ** 2.0d0) / (k ** 4.0d0)))))
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) {
	return t_s * (2.0 * (1.0 / (t_m / (Math.pow(l, 2.0) / Math.pow(k, 4.0)))));
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (2.0 * (1.0 / (t_m / (math.pow(l, 2.0) / math.pow(k, 4.0)))))
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 * Float64(1.0 / Float64(t_m / Float64((l ^ 2.0) / (k ^ 4.0))))))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (2.0 * (1.0 / (t_m / ((l ^ 2.0) / (k ^ 4.0)))));
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 * N[(2.0 * N[(1.0 / N[(t$95$m / N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \left(2 \cdot \frac{1}{\frac{t_m}{\frac{{\ell}^{2}}{{k}^{4}}}}\right)
\end{array}
Derivation
  1. Initial program 51.3%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt29.2%

      \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow229.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
  4. Applied egg-rr31.3%

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
  5. Taylor expanded in k around inf 37.2%

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

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

    \[\leadsto \frac{2}{{\color{blue}{\left(\frac{\left(k \cdot \sin k\right) \cdot \sqrt{\frac{t}{\cos k}}}{\ell}\right)}}^{2}} \]
  8. Taylor expanded in k around 0 52.2%

    \[\leadsto \color{blue}{2 \cdot \frac{{\ell}^{2}}{{k}^{4} \cdot t}} \]
  9. Step-by-step derivation
    1. pow252.2%

      \[\leadsto 2 \cdot \frac{\color{blue}{\ell \cdot \ell}}{{k}^{4} \cdot t} \]
    2. clear-num52.2%

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{{k}^{4} \cdot t}{\ell \cdot \ell}}} \]
    3. inv-pow52.2%

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
    2. associate-/l*52.7%

      \[\leadsto 2 \cdot \frac{1}{\color{blue}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  12. Simplified52.7%

    \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}}} \]
  13. Final simplification52.7%

    \[\leadsto 2 \cdot \frac{1}{\frac{t}{\frac{{\ell}^{2}}{{k}^{4}}}} \]
  14. Add Preprocessing

Alternative 10: 52.1% accurate, 2.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t_s \cdot \left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t_m}\right) \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (* t_s (* 2.0 (/ (/ (pow l 2.0) (pow k 4.0)) t_m))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	return t_s * (2.0 * ((pow(l, 2.0) / pow(k, 4.0)) / t_m));
}
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
    code = t_s * (2.0d0 * (((l ** 2.0d0) / (k ** 4.0d0)) / t_m))
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) {
	return t_s * (2.0 * ((Math.pow(l, 2.0) / Math.pow(k, 4.0)) / t_m));
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	return t_s * (2.0 * ((math.pow(l, 2.0) / math.pow(k, 4.0)) / t_m))
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	return Float64(t_s * Float64(2.0 * Float64(Float64((l ^ 2.0) / (k ^ 4.0)) / t_m)))
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp = code(t_s, t_m, l, k)
	tmp = t_s * (2.0 * (((l ^ 2.0) / (k ^ 4.0)) / t_m));
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 * N[(2.0 * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision] / t$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t_s \cdot \left(2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t_m}\right)
\end{array}
Derivation
  1. Initial program 51.3%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + 1\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt29.2%

      \[\leadsto \frac{2}{\color{blue}{\sqrt{\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)} \cdot \sqrt{\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. pow229.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\sqrt{\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)}\right)}^{2}}} \]
  4. Applied egg-rr31.3%

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\sqrt{\sin k \cdot \tan k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}}} \]
  5. Taylor expanded in k around 0 36.5%

    \[\leadsto \frac{2}{{\left(\left(\color{blue}{k} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \mathsf{hypot}\left(1, \mathsf{hypot}\left(1, \frac{k}{t}\right)\right)\right)}^{2}} \]
  6. Taylor expanded in k around inf 52.2%

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

      \[\leadsto 2 \cdot \color{blue}{\frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
  8. Simplified52.7%

    \[\leadsto \color{blue}{2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t}} \]
  9. Final simplification52.7%

    \[\leadsto 2 \cdot \frac{\frac{{\ell}^{2}}{{k}^{4}}}{t} \]
  10. Add Preprocessing

Reproduce

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