Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.0% → 79.6%
Time: 28.9s
Alternatives: 15
Speedup: 2.0×

Specification

?
\[\begin{array}{l} \\ \frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/
  2.0
  (*
   (* (* (/ (pow t 3.0) (* l l)) (sin k)) (tan k))
   (- (+ 1.0 (pow (/ k t) 2.0)) 1.0))))
double code(double t, double l, double k) {
	return 2.0 / ((((pow(t, 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + pow((k / t), 2.0)) - 1.0));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = 2.0d0 / (((((t ** 3.0d0) / (l * l)) * sin(k)) * tan(k)) * ((1.0d0 + ((k / t) ** 2.0d0)) - 1.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 / ((((Math.pow(t, 3.0) / (l * l)) * Math.sin(k)) * Math.tan(k)) * ((1.0 + Math.pow((k / t), 2.0)) - 1.0));
}
def code(t, l, k):
	return 2.0 / ((((math.pow(t, 3.0) / (l * l)) * math.sin(k)) * math.tan(k)) * ((1.0 + math.pow((k / t), 2.0)) - 1.0))
function code(t, l, k)
	return Float64(2.0 / Float64(Float64(Float64(Float64((t ^ 3.0) / Float64(l * l)) * sin(k)) * tan(k)) * Float64(Float64(1.0 + (Float64(k / t) ^ 2.0)) - 1.0)))
end
function tmp = code(t, l, k)
	tmp = 2.0 / (((((t ^ 3.0) / (l * l)) * sin(k)) * tan(k)) * ((1.0 + ((k / t) ^ 2.0)) - 1.0));
end
code[t_, l_, k_] := N[(2.0 / N[(N[(N[(N[(N[Power[t, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 35.0% 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: 79.6% accurate, 0.6× 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(t\_m \cdot {\left(\sqrt[3]{k} \cdot \sqrt[3]{\frac{1}{t\_m}}\right)}^{2}\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/
     2.0
     (*
      (pow (* t_m (pow (* (cbrt k) (cbrt (/ 1.0 t_m))) 2.0)) 3.0)
      (* (sin k) (* (tan k) (pow l -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 ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (pow((t_m * pow((cbrt(k) * cbrt((1.0 / t_m))), 2.0)), 3.0) * (sin(k) * (tan(k) * pow(l, -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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (Math.pow((t_m * Math.pow((Math.cbrt(k) * Math.cbrt((1.0 / t_m))), 2.0)), 3.0) * (Math.sin(k) * (Math.tan(k) * Math.pow(l, -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 (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64((Float64(t_m * (Float64(cbrt(k) * cbrt(Float64(1.0 / t_m))) ^ 2.0)) ^ 3.0) * Float64(sin(k) * Float64(tan(k) * (l ^ -2.0)))));
	end
	return Float64(t_s * tmp)
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[Power[N[(t$95$m * N[Power[N[(N[Power[k, 1/3], $MachinePrecision] * N[Power[N[(1.0 / t$95$m), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[l, -2.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 \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{{\left(t\_m \cdot {\left(\sqrt[3]{k} \cdot \sqrt[3]{\frac{1}{t\_m}}\right)}^{2}\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 36.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*36.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified36.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt36.2%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{\left({\left(\sqrt[3]{\frac{k}{t}}\right)}^{2} \cdot t\right)}^{3} \cdot {\left(\sqrt[3]{\left(\sin k \cdot \tan k\right) \cdot {\ell}^{-2}}\right)}^{3}}} \]
      3. rem-cube-cbrt72.3%

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left({\left(\sqrt[3]{\frac{k}{t}}\right)}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)}} \]
    9. Step-by-step derivation
      1. pow1/346.1%

        \[\leadsto \frac{2}{{\left({\color{blue}{\left({\left(\frac{k}{t}\right)}^{0.3333333333333333}\right)}}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)} \]
      2. div-inv46.0%

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

        \[\leadsto \frac{2}{{\left({\color{blue}{\left({k}^{0.3333333333333333} \cdot {\left(\frac{1}{t}\right)}^{0.3333333333333333}\right)}}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)} \]
      4. pow1/331.5%

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

      \[\leadsto \frac{2}{{\left({\color{blue}{\left(\sqrt[3]{k} \cdot {\left(\frac{1}{t}\right)}^{0.3333333333333333}\right)}}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)} \]
    11. Step-by-step derivation
      1. unpow1/377.6%

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

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

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

Alternative 2: 71.0% accurate, 0.3× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := {\left(\frac{k}{t\_m}\right)}^{2}\\ t_3 := \left(\tan k \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + t\_2\right) + -1\right)\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-18}:\\ \;\;\;\;\frac{t\_m}{k} \cdot \frac{\frac{2}{{t\_m}^{3}}}{\frac{\frac{k}{t\_m}}{\frac{{\ell}^{2}}{\sin k \cdot \tan k}}}\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+251}:\\ \;\;\;\;\frac{2}{\left(\tan k \cdot t\_2\right) \cdot \left(\sin k \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (pow (/ k t_m) 2.0))
        (t_3
         (*
          (* (tan k) (* (sin k) (/ (pow t_m 3.0) (* l l))))
          (+ (+ 1.0 t_2) -1.0))))
   (*
    t_s
    (if (<= t_3 -5e-18)
      (*
       (/ t_m k)
       (/
        (/ 2.0 (pow t_m 3.0))
        (/ (/ k t_m) (/ (pow l 2.0) (* (sin k) (tan k))))))
      (if (<= t_3 2e+251)
        (/ 2.0 (* (* (tan k) t_2) (* (sin k) (/ (/ (pow t_m 3.0) l) l))))
        (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 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 t_2 = pow((k / t_m), 2.0);
	double t_3 = (tan(k) * (sin(k) * (pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0);
	double tmp;
	if (t_3 <= -5e-18) {
		tmp = (t_m / k) * ((2.0 / pow(t_m, 3.0)) / ((k / t_m) / (pow(l, 2.0) / (sin(k) * tan(k)))));
	} else if (t_3 <= 2e+251) {
		tmp = 2.0 / ((tan(k) * t_2) * (sin(k) * ((pow(t_m, 3.0) / l) / l)));
	} else {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_2 = (k / t_m) ** 2.0d0
    t_3 = (tan(k) * (sin(k) * ((t_m ** 3.0d0) / (l * l)))) * ((1.0d0 + t_2) + (-1.0d0))
    if (t_3 <= (-5d-18)) then
        tmp = (t_m / k) * ((2.0d0 / (t_m ** 3.0d0)) / ((k / t_m) / ((l ** 2.0d0) / (sin(k) * tan(k)))))
    else if (t_3 <= 2d+251) then
        tmp = 2.0d0 / ((tan(k) * t_2) * (sin(k) * (((t_m ** 3.0d0) / l) / l)))
    else
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 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 t_2 = Math.pow((k / t_m), 2.0);
	double t_3 = (Math.tan(k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0);
	double tmp;
	if (t_3 <= -5e-18) {
		tmp = (t_m / k) * ((2.0 / Math.pow(t_m, 3.0)) / ((k / t_m) / (Math.pow(l, 2.0) / (Math.sin(k) * Math.tan(k)))));
	} else if (t_3 <= 2e+251) {
		tmp = 2.0 / ((Math.tan(k) * t_2) * (Math.sin(k) * ((Math.pow(t_m, 3.0) / l) / l)));
	} else {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 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):
	t_2 = math.pow((k / t_m), 2.0)
	t_3 = (math.tan(k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0)
	tmp = 0
	if t_3 <= -5e-18:
		tmp = (t_m / k) * ((2.0 / math.pow(t_m, 3.0)) / ((k / t_m) / (math.pow(l, 2.0) / (math.sin(k) * math.tan(k)))))
	elif t_3 <= 2e+251:
		tmp = 2.0 / ((math.tan(k) * t_2) * (math.sin(k) * ((math.pow(t_m, 3.0) / l) / l)))
	else:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(k / t_m) ^ 2.0
	t_3 = Float64(Float64(tan(k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(Float64(1.0 + t_2) + -1.0))
	tmp = 0.0
	if (t_3 <= -5e-18)
		tmp = Float64(Float64(t_m / k) * Float64(Float64(2.0 / (t_m ^ 3.0)) / Float64(Float64(k / t_m) / Float64((l ^ 2.0) / Float64(sin(k) * tan(k))))));
	elseif (t_3 <= 2e+251)
		tmp = Float64(2.0 / Float64(Float64(tan(k) * t_2) * Float64(sin(k) * Float64(Float64((t_m ^ 3.0) / l) / l))));
	else
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 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)
	t_2 = (k / t_m) ^ 2.0;
	t_3 = (tan(k) * (sin(k) * ((t_m ^ 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0);
	tmp = 0.0;
	if (t_3 <= -5e-18)
		tmp = (t_m / k) * ((2.0 / (t_m ^ 3.0)) / ((k / t_m) / ((l ^ 2.0) / (sin(k) * tan(k)))));
	elseif (t_3 <= 2e+251)
		tmp = 2.0 / ((tan(k) * t_2) * (sin(k) * (((t_m ^ 3.0) / l) / l)));
	else
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 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_] := Block[{t$95$2 = N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + t$95$2), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$s * If[LessEqual[t$95$3, -5e-18], N[(N[(t$95$m / k), $MachinePrecision] * N[(N[(2.0 / N[Power[t$95$m, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(k / t$95$m), $MachinePrecision] / N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+251], N[(2.0 / N[(N[(N[Tan[k], $MachinePrecision] * t$95$2), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / l), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := {\left(\frac{k}{t\_m}\right)}^{2}\\
t_3 := \left(\tan k \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + t\_2\right) + -1\right)\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-18}:\\
\;\;\;\;\frac{t\_m}{k} \cdot \frac{\frac{2}{{t\_m}^{3}}}{\frac{\frac{k}{t\_m}}{\frac{{\ell}^{2}}{\sin k \cdot \tan k}}}\\

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+251}:\\
\;\;\;\;\frac{2}{\left(\tan k \cdot t\_2\right) \cdot \left(\sin k \cdot \frac{\frac{{t\_m}^{3}}{\ell}}{\ell}\right)}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) < -5.00000000000000036e-18

    1. Initial program 82.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. Step-by-step derivation
      1. associate-/r*82.1%

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{\frac{-k}{t}} \cdot \left(-\frac{k}{t}\right) + 1\right) - 1} \]
      9. distribute-frac-neg82.0%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{{\left(\frac{-k}{t}\right)}^{2} + \color{blue}{0}} \]
      13. +-rgt-identity82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow282.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\frac{-k}{t} \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
      16. distribute-frac-neg82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \left(-\frac{k}{t}\right)} \]
      17. sqr-neg82.0%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      18. unpow282.0%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-un-lft-identity82.0%

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

        \[\leadsto \frac{1 \cdot \frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      3. times-frac92.3%

        \[\leadsto \color{blue}{\frac{1}{\frac{k}{t}} \cdot \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\frac{k}{t}}} \]
      4. clear-num92.4%

        \[\leadsto \color{blue}{\frac{t}{k}} \cdot \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\frac{k}{t}} \]
      5. associate-/r/92.4%

        \[\leadsto \frac{t}{k} \cdot \frac{\color{blue}{\frac{2}{{t}^{3}} \cdot \frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}{\frac{k}{t}} \]
      6. associate-/r*92.5%

        \[\leadsto \frac{t}{k} \cdot \frac{\frac{2}{{t}^{3}} \cdot \color{blue}{\frac{\frac{\ell \cdot \ell}{\sin k}}{\tan k}}}{\frac{k}{t}} \]
      7. pow292.5%

        \[\leadsto \frac{t}{k} \cdot \frac{\frac{2}{{t}^{3}} \cdot \frac{\frac{\color{blue}{{\ell}^{2}}}{\sin k}}{\tan k}}{\frac{k}{t}} \]
    6. Applied egg-rr92.5%

      \[\leadsto \color{blue}{\frac{t}{k} \cdot \frac{\frac{2}{{t}^{3}} \cdot \frac{\frac{{\ell}^{2}}{\sin k}}{\tan k}}{\frac{k}{t}}} \]
    7. Step-by-step derivation
      1. associate-/l*96.1%

        \[\leadsto \frac{t}{k} \cdot \color{blue}{\frac{\frac{2}{{t}^{3}}}{\frac{\frac{k}{t}}{\frac{\frac{{\ell}^{2}}{\sin k}}{\tan k}}}} \]
      2. associate-/l/96.2%

        \[\leadsto \frac{t}{k} \cdot \frac{\frac{2}{{t}^{3}}}{\frac{\frac{k}{t}}{\color{blue}{\frac{{\ell}^{2}}{\tan k \cdot \sin k}}}} \]
      3. *-commutative96.2%

        \[\leadsto \frac{t}{k} \cdot \frac{\frac{2}{{t}^{3}}}{\frac{\frac{k}{t}}{\frac{{\ell}^{2}}{\color{blue}{\sin k \cdot \tan k}}}} \]
    8. Simplified96.2%

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

    if -5.00000000000000036e-18 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) < 2.0000000000000001e251

    1. Initial program 81.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. Step-by-step derivation
      1. associate-*l*81.9%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + \left(-1\right)\right)}} \]
      4. distribute-rgt-in69.0%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\left(1 + \color{blue}{\frac{k \cdot k}{t \cdot t}}\right) \cdot \tan k + \left(-1\right) \cdot \tan k} \]
      7. sqr-neg54.6%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\left(1 + \color{blue}{{\left(\frac{k}{-t}\right)}^{2}}\right) \cdot \tan k + \left(-1\right) \cdot \tan k} \]
      10. distribute-rgt-in81.9%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \left(\color{blue}{\left({\left(\frac{k}{-t}\right)}^{2} + 1\right)} + \left(-1\right)\right)} \]
      12. associate-+l+90.9%

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e251 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))

    1. Initial program 6.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. Step-by-step derivation
      1. associate-*l*6.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified6.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 48.8%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*48.8%

        \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    9. Simplified48.8%

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*48.7%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
      5. log1p-expm1-u45.8%

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt39.1%

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

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

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

Alternative 3: 71.1% accurate, 0.5× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ \begin{array}{l} t_2 := {\left(\frac{k}{t\_m}\right)}^{2}\\ t\_s \cdot \begin{array}{l} \mathbf{if}\;\left(\tan k \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + t\_2\right) + -1\right) \leq 2 \cdot 10^{+251}:\\ \;\;\;\;\frac{\frac{2}{\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}}{\tan k \cdot t\_2}\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \end{array} \end{array} \end{array} \]
t_m = (fabs.f64 t)
t_s = (copysign.f64 1 t)
(FPCore (t_s t_m l k)
 :precision binary64
 (let* ((t_2 (pow (/ k t_m) 2.0)))
   (*
    t_s
    (if (<=
         (*
          (* (tan k) (* (sin k) (/ (pow t_m 3.0) (* l l))))
          (+ (+ 1.0 t_2) -1.0))
         2e+251)
      (/ (/ 2.0 (* (sin k) (* (/ (pow t_m 2.0) l) (/ t_m l)))) (* (tan k) t_2))
      (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 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 t_2 = pow((k / t_m), 2.0);
	double tmp;
	if (((tan(k) * (sin(k) * (pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0)) <= 2e+251) {
		tmp = (2.0 / (sin(k) * ((pow(t_m, 2.0) / l) * (t_m / l)))) / (tan(k) * t_2);
	} else {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 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) :: t_2
    real(8) :: tmp
    t_2 = (k / t_m) ** 2.0d0
    if (((tan(k) * (sin(k) * ((t_m ** 3.0d0) / (l * l)))) * ((1.0d0 + t_2) + (-1.0d0))) <= 2d+251) then
        tmp = (2.0d0 / (sin(k) * (((t_m ** 2.0d0) / l) * (t_m / l)))) / (tan(k) * t_2)
    else
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 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 t_2 = Math.pow((k / t_m), 2.0);
	double tmp;
	if (((Math.tan(k) * (Math.sin(k) * (Math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0)) <= 2e+251) {
		tmp = (2.0 / (Math.sin(k) * ((Math.pow(t_m, 2.0) / l) * (t_m / l)))) / (Math.tan(k) * t_2);
	} else {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 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):
	t_2 = math.pow((k / t_m), 2.0)
	tmp = 0
	if ((math.tan(k) * (math.sin(k) * (math.pow(t_m, 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0)) <= 2e+251:
		tmp = (2.0 / (math.sin(k) * ((math.pow(t_m, 2.0) / l) * (t_m / l)))) / (math.tan(k) * t_2)
	else:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	t_2 = Float64(k / t_m) ^ 2.0
	tmp = 0.0
	if (Float64(Float64(tan(k) * Float64(sin(k) * Float64((t_m ^ 3.0) / Float64(l * l)))) * Float64(Float64(1.0 + t_2) + -1.0)) <= 2e+251)
		tmp = Float64(Float64(2.0 / Float64(sin(k) * Float64(Float64((t_m ^ 2.0) / l) * Float64(t_m / l)))) / Float64(tan(k) * t_2));
	else
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 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)
	t_2 = (k / t_m) ^ 2.0;
	tmp = 0.0;
	if (((tan(k) * (sin(k) * ((t_m ^ 3.0) / (l * l)))) * ((1.0 + t_2) + -1.0)) <= 2e+251)
		tmp = (2.0 / (sin(k) * (((t_m ^ 2.0) / l) * (t_m / l)))) / (tan(k) * t_2);
	else
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 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_] := Block[{t$95$2 = N[Power[N[(k / t$95$m), $MachinePrecision], 2.0], $MachinePrecision]}, N[(t$95$s * If[LessEqual[N[(N[(N[Tan[k], $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + t$95$2), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], 2e+251], N[(N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[(N[(N[Power[t$95$m, 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(t$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
\begin{array}{l}
t_2 := {\left(\frac{k}{t\_m}\right)}^{2}\\
t\_s \cdot \begin{array}{l}
\mathbf{if}\;\left(\tan k \cdot \left(\sin k \cdot \frac{{t\_m}^{3}}{\ell \cdot \ell}\right)\right) \cdot \left(\left(1 + t\_2\right) + -1\right) \leq 2 \cdot 10^{+251}:\\
\;\;\;\;\frac{\frac{2}{\sin k \cdot \left(\frac{{t\_m}^{2}}{\ell} \cdot \frac{t\_m}{\ell}\right)}}{\tan k \cdot t\_2}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1)) < 2.0000000000000001e251

    1. Initial program 82.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. Step-by-step derivation
      1. associate-*l*82.0%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + \left(-1\right)\right)}} \]
      4. distribute-rgt-in72.8%

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\left(1 + \color{blue}{{\left(\frac{k}{-t}\right)}^{2}}\right) \cdot \tan k + \left(-1\right) \cdot \tan k} \]
      10. distribute-rgt-in81.9%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \left(\color{blue}{\left({\left(\frac{k}{-t}\right)}^{2} + 1\right)} + \left(-1\right)\right)} \]
      12. associate-+l+88.3%

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

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

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

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

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

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

    if 2.0000000000000001e251 < (*.f64 (*.f64 (*.f64 (/.f64 (pow.f64 t 3) (*.f64 l l)) (sin.f64 k)) (tan.f64 k)) (-.f64 (+.f64 1 (pow.f64 (/.f64 k t) 2)) 1))

    1. Initial program 6.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. Step-by-step derivation
      1. associate-*l*6.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified6.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 48.8%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*48.8%

        \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    9. Simplified48.8%

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*48.7%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
      5. log1p-expm1-u45.8%

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

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt39.1%

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

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

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

Alternative 4: 79.6% accurate, 0.6× 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right) \cdot {\left(t\_m \cdot {\left(\frac{\sqrt[3]{k}}{\sqrt[3]{t\_m}}\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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/
     2.0
     (*
      (* (sin k) (* (tan k) (pow l -2.0)))
      (pow (* t_m (pow (/ (cbrt k) (cbrt t_m)) 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 ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / ((sin(k) * (tan(k) * pow(l, -2.0))) * pow((t_m * pow((cbrt(k) / cbrt(t_m)), 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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / ((Math.sin(k) * (Math.tan(k) * Math.pow(l, -2.0))) * Math.pow((t_m * Math.pow((Math.cbrt(k) / Math.cbrt(t_m)), 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 (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64(sin(k) * Float64(tan(k) * (l ^ -2.0))) * (Float64(t_m * (Float64(cbrt(k) / cbrt(t_m)) ^ 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[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[(t$95$m * N[Power[N[(N[Power[k, 1/3], $MachinePrecision] / N[Power[t$95$m, 1/3], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right) \cdot {\left(t\_m \cdot {\left(\frac{\sqrt[3]{k}}{\sqrt[3]{t\_m}}\right)}^{2}\right)}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 36.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*36.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified36.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt36.2%

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

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

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

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

        \[\leadsto \frac{2}{\color{blue}{{\left({\left(\sqrt[3]{\frac{k}{t}}\right)}^{2} \cdot t\right)}^{3} \cdot {\left(\sqrt[3]{\left(\sin k \cdot \tan k\right) \cdot {\ell}^{-2}}\right)}^{3}}} \]
      3. rem-cube-cbrt72.3%

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left({\left(\sqrt[3]{\frac{k}{t}}\right)}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)}} \]
    9. Step-by-step derivation
      1. cbrt-div77.6%

        \[\leadsto \frac{2}{{\left({\color{blue}{\left(\frac{\sqrt[3]{k}}{\sqrt[3]{t}}\right)}}^{2} \cdot t\right)}^{3} \cdot \left(\sin k \cdot \left(\tan k \cdot {\ell}^{-2}\right)\right)} \]
    10. Applied egg-rr77.6%

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

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

Alternative 5: 78.0% accurate, 0.6× 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{{\left(\sqrt[3]{{\ell}^{-2} \cdot {k}^{2}}\right)}^{3} \cdot \frac{t\_m \cdot {\sin k}^{2}}{\cos k}}\\ \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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/
     2.0
     (*
      (pow (cbrt (* (pow l -2.0) (pow k 2.0))) 3.0)
      (/ (* t_m (pow (sin k) 2.0)) (cos k)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (pow(cbrt((pow(l, -2.0) * pow(k, 2.0))), 3.0) * ((t_m * pow(sin(k), 2.0)) / cos(k)));
	}
	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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (Math.pow(Math.cbrt((Math.pow(l, -2.0) * Math.pow(k, 2.0))), 3.0) * ((t_m * Math.pow(Math.sin(k), 2.0)) / Math.cos(k)));
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64((cbrt(Float64((l ^ -2.0) * (k ^ 2.0))) ^ 3.0) * Float64(Float64(t_m * (sin(k) ^ 2.0)) / cos(k))));
	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[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[Power[N[Power[N[(N[Power[l, -2.0], $MachinePrecision] * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision] * N[(N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 36.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*36.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified36.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 74.2%

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Simplified74.9%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    8. Step-by-step derivation
      1. add-cube-cbrt74.7%

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

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

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

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

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

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

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

Alternative 6: 77.6% accurate, 0.7× 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+297}:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{\sin k \cdot {\left(\frac{t\_m}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3}}}{\tan k \cdot {\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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (if (<= (* l l) 5e+297)
      (/
       2.0
       (* (/ (* t_m (pow (sin k) 2.0)) (cos k)) (/ (pow k 2.0) (pow l 2.0))))
      (/
       (/ 2.0 (* (sin k) (pow (/ t_m (pow (cbrt l) 2.0)) 3.0)))
       (* (tan k) (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 ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else if ((l * l) <= 5e+297) {
		tmp = 2.0 / (((t_m * pow(sin(k), 2.0)) / cos(k)) * (pow(k, 2.0) / pow(l, 2.0)));
	} else {
		tmp = (2.0 / (sin(k) * pow((t_m / pow(cbrt(l), 2.0)), 3.0))) / (tan(k) * pow((k / t_m), 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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else if ((l * l) <= 5e+297) {
		tmp = 2.0 / (((t_m * Math.pow(Math.sin(k), 2.0)) / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 2.0)));
	} else {
		tmp = (2.0 / (Math.sin(k) * Math.pow((t_m / Math.pow(Math.cbrt(l), 2.0)), 3.0))) / (Math.tan(k) * 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 (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	elseif (Float64(l * l) <= 5e+297)
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (sin(k) ^ 2.0)) / cos(k)) * Float64((k ^ 2.0) / (l ^ 2.0))));
	else
		tmp = Float64(Float64(2.0 / Float64(sin(k) * (Float64(t_m / (cbrt(l) ^ 2.0)) ^ 3.0))) / Float64(tan(k) * (Float64(k / t_m) ^ 2.0)));
	end
	return Float64(t_s * tmp)
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], If[LessEqual[N[(l * l), $MachinePrecision], 5e+297], N[(2.0 / N[(N[(N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(N[Sin[k], $MachinePrecision] * N[Power[N[(t$95$m / N[Power[N[Power[l, 1/3], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[k], $MachinePrecision] * 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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

\mathbf{elif}\;\ell \cdot \ell \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{2}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{2}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l) < 4.9999999999999998e297

    1. Initial program 35.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. Step-by-step derivation
      1. associate-*l*35.6%

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

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

      \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 84.8%

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Simplified86.4%

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

    if 4.9999999999999998e297 < (*.f64 l l)

    1. Initial program 37.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. Step-by-step derivation
      1. associate-*l*37.3%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + \left(-1\right)\right)}} \]
      4. distribute-rgt-in35.9%

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\left(1 + \color{blue}{{\left(\frac{k}{-t}\right)}^{2}}\right) \cdot \tan k + \left(-1\right) \cdot \tan k} \]
      10. distribute-rgt-in37.3%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \left(\color{blue}{\left({\left(\frac{k}{-t}\right)}^{2} + 1\right)} + \left(-1\right)\right)} \]
      12. associate-+l+38.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt38.6%

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

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

        \[\leadsto \frac{\frac{2}{\left({\color{blue}{\left(\frac{\sqrt[3]{{t}^{3}}}{\sqrt[3]{\ell \cdot \ell}}\right)}}^{2} \cdot \sqrt[3]{\frac{{t}^{3}}{\ell \cdot \ell}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      4. rem-cbrt-cube38.6%

        \[\leadsto \frac{\frac{2}{\left({\left(\frac{\color{blue}{t}}{\sqrt[3]{\ell \cdot \ell}}\right)}^{2} \cdot \sqrt[3]{\frac{{t}^{3}}{\ell \cdot \ell}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      5. cbrt-prod38.6%

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

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

        \[\leadsto \frac{\frac{2}{\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{2} \cdot \color{blue}{\frac{\sqrt[3]{{t}^{3}}}{\sqrt[3]{\ell \cdot \ell}}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      8. rem-cbrt-cube47.7%

        \[\leadsto \frac{\frac{2}{\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{2} \cdot \frac{\color{blue}{t}}{\sqrt[3]{\ell \cdot \ell}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      9. cbrt-prod60.9%

        \[\leadsto \frac{\frac{2}{\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{2} \cdot \frac{t}{\color{blue}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      10. pow260.9%

        \[\leadsto \frac{\frac{2}{\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{2} \cdot \frac{t}{\color{blue}{{\left(\sqrt[3]{\ell}\right)}^{2}}}\right) \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
    6. Applied egg-rr60.9%

      \[\leadsto \frac{\frac{2}{\color{blue}{\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{2} \cdot \frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)} \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
    7. Step-by-step derivation
      1. pow-plus60.9%

        \[\leadsto \frac{\frac{2}{\color{blue}{{\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{\left(2 + 1\right)}} \cdot \sin k}}{\tan k \cdot \left({\left(\frac{k}{t}\right)}^{2} + 0\right)} \]
      2. metadata-eval60.9%

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

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

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

Alternative 7: 77.8% 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos k \cdot {\ell}^{2}}{{\sin k}^{2} \cdot \left(t\_m \cdot {k}^{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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (*
     2.0
     (/ (* (cos k) (pow l 2.0)) (* (pow (sin k) 2.0) (* t_m (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 ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 * ((cos(k) * pow(l, 2.0)) / (pow(sin(k), 2.0) * (t_m * 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 ((l * l) <= 0.0d0) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 2.0d0
    else
        tmp = 2.0d0 * ((cos(k) * (l ** 2.0d0)) / ((sin(k) ** 2.0d0) * (t_m * (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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 * ((Math.cos(k) * Math.pow(l, 2.0)) / (Math.pow(Math.sin(k), 2.0) * (t_m * 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 (l * l) <= 0.0:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	else:
		tmp = 2.0 * ((math.cos(k) * math.pow(l, 2.0)) / (math.pow(math.sin(k), 2.0) * (t_m * 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 (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 * Float64(Float64(cos(k) * (l ^ 2.0)) / Float64((sin(k) ^ 2.0) * Float64(t_m * (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 ((l * l) <= 0.0)
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = 2.0 * ((cos(k) * (l ^ 2.0)) / ((sin(k) ^ 2.0) * (t_m * (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[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 * N[(N[(N[Cos[k], $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$m * N[Power[k, 2.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 \begin{array}{l}
\mathbf{if}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 36.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*36.2%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \color{blue}{\left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) + \left(-1\right)\right)}} \]
      4. distribute-rgt-in32.0%

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\left(1 + \color{blue}{{\left(\frac{k}{-t}\right)}^{2}}\right) \cdot \tan k + \left(-1\right) \cdot \tan k} \]
      10. distribute-rgt-in36.2%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k}}{\tan k \cdot \left(\color{blue}{\left({\left(\frac{k}{-t}\right)}^{2} + 1\right)} + \left(-1\right)\right)} \]
      12. associate-+l+44.4%

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

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

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

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

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

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

Alternative 8: 78.3% 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}\;\ell \cdot \ell \leq 0:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t\_m \cdot {\sin k}^{2}}{\cos k} \cdot \frac{{k}^{2}}{{\ell}^{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 (<= (* l l) 0.0)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/
     2.0
     (* (/ (* t_m (pow (sin k) 2.0)) (cos k)) (/ (pow k 2.0) (pow l 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 ((l * l) <= 0.0) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (((t_m * pow(sin(k), 2.0)) / cos(k)) * (pow(k, 2.0) / pow(l, 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 ((l * l) <= 0.0d0) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 2.0d0
    else
        tmp = 2.0d0 / (((t_m * (sin(k) ** 2.0d0)) / cos(k)) * ((k ** 2.0d0) / (l ** 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 ((l * l) <= 0.0) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (((t_m * Math.pow(Math.sin(k), 2.0)) / Math.cos(k)) * (Math.pow(k, 2.0) / Math.pow(l, 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 (l * l) <= 0.0:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	else:
		tmp = 2.0 / (((t_m * math.pow(math.sin(k), 2.0)) / math.cos(k)) * (math.pow(k, 2.0) / math.pow(l, 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 (Float64(l * l) <= 0.0)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64(Float64(t_m * (sin(k) ^ 2.0)) / cos(k)) * Float64((k ^ 2.0) / (l ^ 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 ((l * l) <= 0.0)
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = 2.0 / (((t_m * (sin(k) ^ 2.0)) / cos(k)) * ((k ^ 2.0) / (l ^ 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[N[(l * l), $MachinePrecision], 0.0], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[(t$95$m * N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $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}\;\ell \cdot \ell \leq 0:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 l l) < 0.0

    1. Initial program 21.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. Step-by-step derivation
      1. associate-*l*21.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified21.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.3%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.2%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt57.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt64.6%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr64.6%

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

    if 0.0 < (*.f64 l l)

    1. Initial program 36.2%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*36.2%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified36.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 74.2%

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Simplified74.9%

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

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

Alternative 9: 69.1% 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 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2 \cdot 10^{+224}\right):\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(t\_m \cdot \frac{2}{k}\right) \cdot \frac{\frac{{\ell}^{2}}{\sin k \cdot \tan k}}{k \cdot {t\_m}^{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 (or (<= k 5.5e-7) (not (<= k 2e+224)))
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (*
     (* t_m (/ 2.0 k))
     (/ (/ (pow l 2.0) (* (sin k) (tan k))) (* k (pow 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 ((k <= 5.5e-7) || !(k <= 2e+224)) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = (t_m * (2.0 / k)) * ((pow(l, 2.0) / (sin(k) * tan(k))) / (k * pow(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 ((k <= 5.5d-7) .or. (.not. (k <= 2d+224))) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 2.0d0
    else
        tmp = (t_m * (2.0d0 / k)) * (((l ** 2.0d0) / (sin(k) * tan(k))) / (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 ((k <= 5.5e-7) || !(k <= 2e+224)) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = (t_m * (2.0 / k)) * ((Math.pow(l, 2.0) / (Math.sin(k) * Math.tan(k))) / (k * Math.pow(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 (k <= 5.5e-7) or not (k <= 2e+224):
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	else:
		tmp = (t_m * (2.0 / k)) * ((math.pow(l, 2.0) / (math.sin(k) * math.tan(k))) / (k * math.pow(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 ((k <= 5.5e-7) || !(k <= 2e+224))
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(Float64(t_m * Float64(2.0 / k)) * Float64(Float64((l ^ 2.0) / Float64(sin(k) * tan(k))) / 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 ((k <= 5.5e-7) || ~((k <= 2e+224)))
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = (t_m * (2.0 / k)) * (((l ^ 2.0) / (sin(k) * tan(k))) / (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[Or[LessEqual[k, 5.5e-7], N[Not[LessEqual[k, 2e+224]], $MachinePrecision]], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(t$95$m * N[(2.0 / k), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[l, 2.0], $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * N[Power[t$95$m, 2.0], $MachinePrecision]), $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 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2 \cdot 10^{+224}\right):\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 5.5000000000000003e-7 or 1.99999999999999994e224 < k

    1. Initial program 34.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. Step-by-step derivation
      1. associate-*l*34.1%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified34.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 60.1%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*59.7%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*60.1%

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

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

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

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

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt35.8%

        \[\leadsto \color{blue}{\sqrt{\frac{2}{\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}{{\ell}^{2}}}} \cdot \sqrt{\frac{2}{\frac{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}{{\ell}^{2}}}}} \]
      7. pow235.8%

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

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

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

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

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

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

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

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

    if 5.5000000000000003e-7 < k < 1.99999999999999994e224

    1. Initial program 26.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. Step-by-step derivation
      1. associate-/r*26.9%

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

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

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

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{\frac{k}{t} \cdot \frac{k}{t}} + 1\right) - 1} \]
      7. sqr-neg26.9%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{\left(-\frac{k}{t}\right) \cdot \left(-\frac{k}{t}\right)} + 1\right) - 1} \]
      8. distribute-frac-neg26.9%

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

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\left(\color{blue}{{\left(\frac{-k}{t}\right)}^{2}} + 1\right) - 1} \]
      11. associate--l+43.6%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2} + \left(1 - 1\right)}} \]
      12. metadata-eval43.6%

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

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{{\left(\frac{-k}{t}\right)}^{2}}} \]
      14. unpow243.6%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{-k}{t} \cdot \frac{-k}{t}}} \]
      15. distribute-frac-neg43.6%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\frac{-k}{t} \cdot \color{blue}{\left(-\frac{k}{t}\right)}} \]
      16. distribute-frac-neg43.6%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\left(-\frac{k}{t}\right)} \cdot \left(-\frac{k}{t}\right)} \]
      17. sqr-neg43.6%

        \[\leadsto \frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      18. unpow243.6%

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

      \[\leadsto \color{blue}{\frac{\frac{2}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{{\left(\frac{k}{t}\right)}^{2}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-inv43.6%

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

        \[\leadsto \frac{2 \cdot \frac{1}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\color{blue}{\frac{k}{t} \cdot \frac{k}{t}}} \]
      3. times-frac51.2%

        \[\leadsto \color{blue}{\frac{2}{\frac{k}{t}} \cdot \frac{\frac{1}{\frac{{t}^{3}}{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}}}{\frac{k}{t}}} \]
      4. clear-num51.3%

        \[\leadsto \frac{2}{\frac{k}{t}} \cdot \frac{\color{blue}{\frac{\frac{\ell \cdot \ell}{\sin k \cdot \tan k}}{{t}^{3}}}}{\frac{k}{t}} \]
      5. associate-/r*51.3%

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

        \[\leadsto \frac{2}{\frac{k}{t}} \cdot \frac{\frac{\frac{\frac{\color{blue}{{\ell}^{2}}}{\sin k}}{\tan k}}{{t}^{3}}}{\frac{k}{t}} \]
    6. Applied egg-rr51.3%

      \[\leadsto \color{blue}{\frac{2}{\frac{k}{t}} \cdot \frac{\frac{\frac{\frac{{\ell}^{2}}{\sin k}}{\tan k}}{{t}^{3}}}{\frac{k}{t}}} \]
    7. Step-by-step derivation
      1. associate-/r/51.3%

        \[\leadsto \color{blue}{\left(\frac{2}{k} \cdot t\right)} \cdot \frac{\frac{\frac{\frac{{\ell}^{2}}{\sin k}}{\tan k}}{{t}^{3}}}{\frac{k}{t}} \]
      2. associate-/l/53.0%

        \[\leadsto \left(\frac{2}{k} \cdot t\right) \cdot \color{blue}{\frac{\frac{\frac{{\ell}^{2}}{\sin k}}{\tan k}}{\frac{k}{t} \cdot {t}^{3}}} \]
      3. associate-/l/53.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2 \cdot 10^{+224}\right):\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\left(t \cdot \frac{2}{k}\right) \cdot \frac{\frac{{\ell}^{2}}{\sin k \cdot \tan k}}{k \cdot {t}^{2}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.3% 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}\;\ell \leq 4.9 \cdot 10^{-160}:\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t\_m \cdot {k}^{2}}{\cos k}}\\ \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 (<= l 4.9e-160)
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/ 2.0 (* (/ (pow k 2.0) (pow l 2.0)) (/ (* t_m (pow k 2.0)) (cos k)))))))
t_m = fabs(t);
t_s = copysign(1.0, t);
double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (l <= 4.9e-160) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / ((pow(k, 2.0) / pow(l, 2.0)) * ((t_m * pow(k, 2.0)) / cos(k)));
	}
	return t_s * tmp;
}
t_m = abs(t)
t_s = copysign(1.0d0, t)
real(8) function code(t_s, t_m, l, k)
    real(8), intent (in) :: t_s
    real(8), intent (in) :: t_m
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (l <= 4.9d-160) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 2.0d0
    else
        tmp = 2.0d0 / (((k ** 2.0d0) / (l ** 2.0d0)) * ((t_m * (k ** 2.0d0)) / cos(k)))
    end if
    code = t_s * tmp
end function
t_m = Math.abs(t);
t_s = Math.copySign(1.0, t);
public static double code(double t_s, double t_m, double l, double k) {
	double tmp;
	if (l <= 4.9e-160) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / ((Math.pow(k, 2.0) / Math.pow(l, 2.0)) * ((t_m * Math.pow(k, 2.0)) / Math.cos(k)));
	}
	return t_s * tmp;
}
t_m = math.fabs(t)
t_s = math.copysign(1.0, t)
def code(t_s, t_m, l, k):
	tmp = 0
	if l <= 4.9e-160:
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	else:
		tmp = 2.0 / ((math.pow(k, 2.0) / math.pow(l, 2.0)) * ((t_m * math.pow(k, 2.0)) / math.cos(k)))
	return t_s * tmp
t_m = abs(t)
t_s = copysign(1.0, t)
function code(t_s, t_m, l, k)
	tmp = 0.0
	if (l <= 4.9e-160)
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64((k ^ 2.0) / (l ^ 2.0)) * Float64(Float64(t_m * (k ^ 2.0)) / cos(k))));
	end
	return Float64(t_s * tmp)
end
t_m = abs(t);
t_s = sign(t) * abs(1.0);
function tmp_2 = code(t_s, t_m, l, k)
	tmp = 0.0;
	if (l <= 4.9e-160)
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = 2.0 / (((k ^ 2.0) / (l ^ 2.0)) * ((t_m * (k ^ 2.0)) / cos(k)));
	end
	tmp_2 = t_s * tmp;
end
t_m = N[Abs[t], $MachinePrecision]
t_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[t]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[t$95$s_, t$95$m_, l_, k_] := N[(t$95$s * If[LessEqual[l, 4.9e-160], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[Power[k, 2.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(t$95$m * N[Power[k, 2.0], $MachinePrecision]), $MachinePrecision] / N[Cos[k], $MachinePrecision]), $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}\;\ell \leq 4.9 \cdot 10^{-160}:\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 4.8999999999999999e-160

    1. Initial program 32.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. Step-by-step derivation
      1. associate-*l*32.9%

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

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

      \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 57.7%

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

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*57.7%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*57.7%

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

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
      5. log1p-expm1-u56.3%

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt41.2%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt45.0%

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

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

    if 4.8999999999999999e-160 < l

    1. Initial program 32.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. Step-by-step derivation
      1. associate-*l*32.0%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \color{blue}{\left(1 + \left({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    3. Simplified32.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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t around 0 69.6%

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

        \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    7. Simplified70.0%

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    8. Taylor expanded in k around 0 59.2%

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

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

Alternative 11: 65.9% 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}\;k \leq 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2.2 \cdot 10^{+128}\right):\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{t\_m}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(\frac{k}{t\_m} \cdot \frac{k}{t\_m}\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 (or (<= k 5.5e-7) (not (<= k 2.2e+128)))
    (pow (* l (sqrt (/ 2.0 (* t_m (pow k 4.0))))) 2.0)
    (/
     2.0
     (*
      (* (/ (pow t_m 3.0) (* l l)) (* (sin k) (tan k)))
      (* (/ k t_m) (/ k t_m)))))))
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 <= 5.5e-7) || !(k <= 2.2e+128)) {
		tmp = pow((l * sqrt((2.0 / (t_m * pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (((pow(t_m, 3.0) / (l * l)) * (sin(k) * tan(k))) * ((k / t_m) * (k / t_m)));
	}
	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 ((k <= 5.5d-7) .or. (.not. (k <= 2.2d+128))) then
        tmp = (l * sqrt((2.0d0 / (t_m * (k ** 4.0d0))))) ** 2.0d0
    else
        tmp = 2.0d0 / ((((t_m ** 3.0d0) / (l * l)) * (sin(k) * tan(k))) * ((k / t_m) * (k / t_m)))
    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 ((k <= 5.5e-7) || !(k <= 2.2e+128)) {
		tmp = Math.pow((l * Math.sqrt((2.0 / (t_m * Math.pow(k, 4.0))))), 2.0);
	} else {
		tmp = 2.0 / (((Math.pow(t_m, 3.0) / (l * l)) * (Math.sin(k) * Math.tan(k))) * ((k / t_m) * (k / t_m)));
	}
	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 <= 5.5e-7) or not (k <= 2.2e+128):
		tmp = math.pow((l * math.sqrt((2.0 / (t_m * math.pow(k, 4.0))))), 2.0)
	else:
		tmp = 2.0 / (((math.pow(t_m, 3.0) / (l * l)) * (math.sin(k) * math.tan(k))) * ((k / t_m) * (k / t_m)))
	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 <= 5.5e-7) || !(k <= 2.2e+128))
		tmp = Float64(l * sqrt(Float64(2.0 / Float64(t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = Float64(2.0 / Float64(Float64(Float64((t_m ^ 3.0) / Float64(l * l)) * Float64(sin(k) * tan(k))) * Float64(Float64(k / t_m) * Float64(k / t_m))));
	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 <= 5.5e-7) || ~((k <= 2.2e+128)))
		tmp = (l * sqrt((2.0 / (t_m * (k ^ 4.0))))) ^ 2.0;
	else
		tmp = 2.0 / ((((t_m ^ 3.0) / (l * l)) * (sin(k) * tan(k))) * ((k / t_m) * (k / t_m)));
	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[Or[LessEqual[k, 5.5e-7], N[Not[LessEqual[k, 2.2e+128]], $MachinePrecision]], N[Power[N[(l * N[Sqrt[N[(2.0 / N[(t$95$m * N[Power[k, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(2.0 / N[(N[(N[(N[Power[t$95$m, 3.0], $MachinePrecision] / N[(l * l), $MachinePrecision]), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(k / t$95$m), $MachinePrecision] * N[(k / t$95$m), $MachinePrecision]), $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 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2.2 \cdot 10^{+128}\right):\\
\;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if k < 5.5000000000000003e-7 or 2.20000000000000017e128 < k

    1. Initial program 33.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. Step-by-step derivation
      1. associate-*l*33.5%

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

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

      \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0 60.6%

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

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

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

        \[\leadsto \frac{2}{\left(t \cdot {k}^{4}\right) \cdot \color{blue}{{\ell}^{\left(-2\right)}}} \]
      4. metadata-eval60.6%

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

      \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
    8. Step-by-step derivation
      1. associate-*l*60.2%

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
    10. Step-by-step derivation
      1. associate-*r*60.6%

        \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
      2. metadata-eval60.6%

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

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

        \[\leadsto \frac{2}{\color{blue}{\frac{t \cdot {k}^{4}}{{\ell}^{2}}}} \]
      5. log1p-expm1-u58.0%

        \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
      6. add-sqr-sqrt38.7%

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

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

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

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

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

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

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}\right)}^{2} \]
      13. add-sqr-sqrt42.7%

        \[\leadsto {\left(\sqrt{\frac{2}{t \cdot {k}^{4}}} \cdot \color{blue}{\ell}\right)}^{2} \]
    11. Applied egg-rr42.7%

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

    if 5.5000000000000003e-7 < k < 2.20000000000000017e128

    1. Initial program 25.7%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Step-by-step derivation
      1. associate-*l*25.7%

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

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

      \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-+r-25.7%

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

        \[\leadsto \frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(\color{blue}{e^{\log \left(1 + {\left(\frac{k}{t}\right)}^{2}\right)}} - 1\right)} \]
      3. log1p-udef25.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 5.5 \cdot 10^{-7} \lor \neg \left(k \leq 2.2 \cdot 10^{+128}\right):\\ \;\;\;\;{\left(\ell \cdot \sqrt{\frac{2}{t \cdot {k}^{4}}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \left(\sin k \cdot \tan k\right)\right) \cdot \left(\frac{k}{t} \cdot \frac{k}{t}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 66.9% accurate, 1.4× speedup?

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

\\
t\_s \cdot {\left(\ell \cdot \sqrt{\frac{2}{t\_m \cdot {k}^{4}}}\right)}^{2}
\end{array}
Derivation
  1. Initial program 32.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. Step-by-step derivation
    1. associate-*l*32.6%

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

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

    \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
  8. Step-by-step derivation
    1. associate-*l*57.3%

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

    \[\leadsto \frac{2}{\color{blue}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}} \]
  10. Step-by-step derivation
    1. associate-*r*57.2%

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

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

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

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

      \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(t \cdot {k}^{4}\right)\right)}}{{\ell}^{2}}} \]
    6. add-sqr-sqrt37.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto {\left(\ell \cdot \sqrt{\frac{2}{t \cdot {k}^{4}}}\right)}^{2} \]
  13. Add Preprocessing

Alternative 13: 61.4% accurate, 2.0× speedup?

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

\\
t\_s \cdot \left(\frac{2}{t\_m \cdot {k}^{4}} \cdot {\ell}^{2}\right)
\end{array}
Derivation
  1. Initial program 32.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. Step-by-step derivation
    1. associate-*l*32.6%

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

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

    \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in k around 0 57.2%

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

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

      \[\leadsto \frac{2}{\color{blue}{t \cdot {k}^{4}}} \cdot {\ell}^{2} \]
  7. Applied egg-rr57.2%

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

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

Alternative 14: 61.4% accurate, 2.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{t\_m \cdot \left({k}^{4} \cdot {\ell}^{-2}\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 (* t_m (* (pow k 4.0) (pow l -2.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 / (t_m * (pow(k, 4.0) * pow(l, -2.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 / (t_m * ((k ** 4.0d0) * (l ** (-2.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 / (t_m * (Math.pow(k, 4.0) * Math.pow(l, -2.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 / (t_m * (math.pow(k, 4.0) * math.pow(l, -2.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(t_m * Float64((k ^ 4.0) * (l ^ -2.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 / (t_m * ((k ^ 4.0) * (l ^ -2.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[(t$95$m * N[(N[Power[k, 4.0], $MachinePrecision] * N[Power[l, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{t\_m \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)}
\end{array}
Derivation
  1. Initial program 32.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. Step-by-step derivation
    1. associate-*l*32.6%

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

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

    \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in k around 0 57.2%

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

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{\left(t \cdot {k}^{4}\right) \cdot {\ell}^{-2}}} \]
  8. Step-by-step derivation
    1. associate-*l*57.3%

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

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

    \[\leadsto \frac{2}{t \cdot \left({k}^{4} \cdot {\ell}^{-2}\right)} \]
  11. Add Preprocessing

Alternative 15: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} t_m = \left|t\right| \\ t_s = \mathsf{copysign}\left(1, t\right) \\ t\_s \cdot \frac{2}{t\_m \cdot \frac{{k}^{4}}{{\ell}^{2}}} \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 (* t_m (/ (pow k 4.0) (pow l 2.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 / (t_m * (pow(k, 4.0) / pow(l, 2.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 / (t_m * ((k ** 4.0d0) / (l ** 2.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 / (t_m * (Math.pow(k, 4.0) / Math.pow(l, 2.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 / (t_m * (math.pow(k, 4.0) / math.pow(l, 2.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(t_m * Float64((k ^ 4.0) / (l ^ 2.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 / (t_m * ((k ^ 4.0) / (l ^ 2.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[(t$95$m * N[(N[Power[k, 4.0], $MachinePrecision] / N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
t_m = \left|t\right|
\\
t_s = \mathsf{copysign}\left(1, t\right)

\\
t\_s \cdot \frac{2}{t\_m \cdot \frac{{k}^{4}}{{\ell}^{2}}}
\end{array}
Derivation
  1. Initial program 32.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. Step-by-step derivation
    1. associate-*l*32.6%

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

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

    \[\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({\left(\frac{k}{t}\right)}^{2} - 1\right)\right)}} \]
  4. Add Preprocessing
  5. Taylor expanded in t around 0 70.5%

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

      \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
  7. Simplified71.0%

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{2}}{{\ell}^{2}} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
  8. Taylor expanded in k around 0 57.2%

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

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

    \[\leadsto \frac{2}{\color{blue}{\frac{{k}^{4}}{{\ell}^{2}} \cdot t}} \]
  11. Final simplification57.3%

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

Reproduce

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