Toniolo and Linder, Equation (10-)

Percentage Accurate: 35.3% → 99.6%
Time: 23.8s
Alternatives: 13
Speedup: 3.8×

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 13 alternatives:

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

Initial Program: 35.3% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \frac{\frac{\ell}{k}}{\sin k} \cdot \left(\frac{2}{t} \cdot \frac{\cos k}{k \cdot \frac{\sin k}{\ell}}\right) \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* (/ (/ l k) (sin k)) (* (/ 2.0 t) (/ (cos k) (* k (/ (sin k) l))))))
double code(double t, double l, double k) {
	return ((l / k) / sin(k)) * ((2.0 / t) * (cos(k) / (k * (sin(k) / l))));
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    code = ((l / k) / sin(k)) * ((2.0d0 / t) * (cos(k) / (k * (sin(k) / l))))
end function
public static double code(double t, double l, double k) {
	return ((l / k) / Math.sin(k)) * ((2.0 / t) * (Math.cos(k) / (k * (Math.sin(k) / l))));
}
def code(t, l, k):
	return ((l / k) / math.sin(k)) * ((2.0 / t) * (math.cos(k) / (k * (math.sin(k) / l))))
function code(t, l, k)
	return Float64(Float64(Float64(l / k) / sin(k)) * Float64(Float64(2.0 / t) * Float64(cos(k) / Float64(k * Float64(sin(k) / l)))))
end
function tmp = code(t, l, k)
	tmp = ((l / k) / sin(k)) * ((2.0 / t) * (cos(k) / (k * (sin(k) / l))));
end
code[t_, l_, k_] := N[(N[(N[(l / k), $MachinePrecision] / N[Sin[k], $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 / t), $MachinePrecision] * N[(N[Cos[k], $MachinePrecision] / N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\ell}{k}}{\sin k} \cdot \left(\frac{2}{t} \cdot \frac{\cos k}{k \cdot \frac{\sin k}{\ell}}\right)
\end{array}
Derivation
  1. Initial program 36.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr14.6%

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Taylor expanded in k around inf 47.4%

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

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

    \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{k \cdot \frac{\sin k}{\ell}} \cdot \frac{\frac{2}{t} \cdot \cos k}{k \cdot \frac{\sin k}{\ell}}} \]
    4. associate-*r/98.6%

      \[\leadsto \frac{1}{\color{blue}{\frac{k \cdot \sin k}{\ell}}} \cdot \frac{\frac{2}{t} \cdot \cos k}{k \cdot \frac{\sin k}{\ell}} \]
    5. clear-num98.6%

      \[\leadsto \color{blue}{\frac{\ell}{k \cdot \sin k}} \cdot \frac{\frac{2}{t} \cdot \cos k}{k \cdot \frac{\sin k}{\ell}} \]
  14. Applied egg-rr98.6%

    \[\leadsto \color{blue}{\frac{\ell}{k \cdot \sin k} \cdot \frac{\frac{2}{t} \cdot \cos k}{k \cdot \frac{\sin k}{\ell}}} \]
  15. Step-by-step derivation
    1. associate-/r*99.7%

      \[\leadsto \color{blue}{\frac{\frac{\ell}{k}}{\sin k}} \cdot \frac{\frac{2}{t} \cdot \cos k}{k \cdot \frac{\sin k}{\ell}} \]
    2. associate-/l*99.7%

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

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

    \[\leadsto \frac{\frac{\ell}{k}}{\sin k} \cdot \left(\frac{2}{t} \cdot \frac{\cos k}{k \cdot \frac{\sin k}{\ell}}\right) \]
  18. Add Preprocessing

Alternative 2: 55.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.25 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{2}{t} \cdot \cos k\right) \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{-2}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.25e-12)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (* (* (/ 2.0 t) (cos k)) (pow (* k (/ (sin k) l)) -2.0))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.25e-12) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = ((2.0 / t) * cos(k)) * pow((k * (sin(k) / l)), -2.0);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.25d-12) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = ((2.0d0 / t) * cos(k)) * ((k * (sin(k) / l)) ** (-2.0d0))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.25e-12) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = ((2.0 / t) * Math.cos(k)) * Math.pow((k * (Math.sin(k) / l)), -2.0);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.25e-12:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = ((2.0 / t) * math.cos(k)) * math.pow((k * (math.sin(k) / l)), -2.0)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.25e-12)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(Float64(Float64(2.0 / t) * cos(k)) * (Float64(k * Float64(sin(k) / l)) ^ -2.0));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.25e-12)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = ((2.0 / t) * cos(k)) * ((k * (sin(k) / l)) ^ -2.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.25e-12], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.25 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 1.24999999999999992e-12 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity41.9%

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

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

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

        \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\frac{t}{\cos k}} \cdot \sqrt{\frac{t}{\cos k}}\right)} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      5. add-sqr-sqrt93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 55.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.12 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{t \cdot \frac{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}}{\cos k}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.12e-12)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (/ 2.0 (* t (/ (pow (* k (/ (sin k) l)) 2.0) (cos k))))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.12e-12) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / (t * (pow((k * (sin(k) / l)), 2.0) / cos(k)));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.12d-12) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = 2.0d0 / (t * (((k * (sin(k) / l)) ** 2.0d0) / cos(k)))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.12e-12) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / (t * (Math.pow((k * (Math.sin(k) / l)), 2.0) / Math.cos(k)));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.12e-12:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = 2.0 / (t * (math.pow((k * (math.sin(k) / l)), 2.0) / math.cos(k)))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.12e-12)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(2.0 / Float64(t * Float64((Float64(k * Float64(sin(k) / l)) ^ 2.0) / cos(k))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.12e-12)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = 2.0 / (t * (((k * (sin(k) / l)) ^ 2.0) / cos(k)));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.12e-12], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(t * N[(N[Power[N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.12 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 1.1200000000000001e-12 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity41.9%

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

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

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

        \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\frac{t}{\cos k}} \cdot \sqrt{\frac{t}{\cos k}}\right)} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      5. add-sqr-sqrt93.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \cos k}{t}}}{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      2. *-un-lft-identity94.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{t}{\cos k} \cdot {\left(\frac{k \cdot \sin k}{\ell}\right)}^{2}}{2}}} \]
      10. inv-pow94.0%

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

        \[\leadsto {\color{blue}{\left(\left(\frac{t}{\cos k} \cdot {\left(\frac{k \cdot \sin k}{\ell}\right)}^{2}\right) \cdot \frac{1}{2}\right)}}^{-1} \]
      12. *-commutative94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 55.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 6.2 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t}{\cos k} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 6.2e-13)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (/ 2.0 (* (/ t (cos k)) (pow (* k (/ (sin k) l)) 2.0)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 6.2e-13) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / ((t / cos(k)) * pow((k * (sin(k) / l)), 2.0));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 6.2d-13) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = 2.0d0 / ((t / cos(k)) * ((k * (sin(k) / l)) ** 2.0d0))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 6.2e-13) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / ((t / Math.cos(k)) * Math.pow((k * (Math.sin(k) / l)), 2.0));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 6.2e-13:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = 2.0 / ((t / math.cos(k)) * math.pow((k * (math.sin(k) / l)), 2.0))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 6.2e-13)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(t / cos(k)) * (Float64(k * Float64(sin(k) / l)) ^ 2.0)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 6.2e-13)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = 2.0 / ((t / cos(k)) * ((k * (sin(k) / l)) ^ 2.0));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 6.2e-13], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 6.2 \cdot 10^{-13}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 6.1999999999999998e-13 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity41.9%

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

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

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

        \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\frac{t}{\cos k}} \cdot \sqrt{\frac{t}{\cos k}}\right)} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      5. add-sqr-sqrt93.9%

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

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

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

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

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

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

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

Alternative 5: 55.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.4 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t}{\cos k} \cdot {\left(\frac{k \cdot \sin k}{\ell}\right)}^{2}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.4e-12)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (/ 2.0 (* (/ t (cos k)) (pow (/ (* k (sin k)) l) 2.0)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.4e-12) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / ((t / cos(k)) * pow(((k * sin(k)) / l), 2.0));
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.4d-12) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = 2.0d0 / ((t / cos(k)) * (((k * sin(k)) / l) ** 2.0d0))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.4e-12) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = 2.0 / ((t / Math.cos(k)) * Math.pow(((k * Math.sin(k)) / l), 2.0));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.4e-12:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = 2.0 / ((t / math.cos(k)) * math.pow(((k * math.sin(k)) / l), 2.0))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.4e-12)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(2.0 / Float64(Float64(t / cos(k)) * (Float64(Float64(k * sin(k)) / l) ^ 2.0)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.4e-12)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = 2.0 / ((t / cos(k)) * (((k * sin(k)) / l) ^ 2.0));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.4e-12], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(k * N[Sin[k], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.4 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e-12 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

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

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

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

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

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

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

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

Alternative 6: 55.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.35 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{t} \cdot \cos k}{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.35e-12)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (/ (* (/ 2.0 t) (cos k)) (pow (* k (/ (sin k) l)) 2.0))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.35e-12) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = ((2.0 / t) * cos(k)) / pow((k * (sin(k) / l)), 2.0);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.35d-12) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = ((2.0d0 / t) * cos(k)) / ((k * (sin(k) / l)) ** 2.0d0)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.35e-12) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = ((2.0 / t) * Math.cos(k)) / Math.pow((k * (Math.sin(k) / l)), 2.0);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.35e-12:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = ((2.0 / t) * math.cos(k)) / math.pow((k * (math.sin(k) / l)), 2.0)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.35e-12)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(Float64(Float64(2.0 / t) * cos(k)) / (Float64(k * Float64(sin(k) / l)) ^ 2.0));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.35e-12)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = ((2.0 / t) * cos(k)) / ((k * (sin(k) / l)) ^ 2.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.35e-12], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 / t), $MachinePrecision] * N[Cos[k], $MachinePrecision]), $MachinePrecision] / N[Power[N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.35 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 1.3499999999999999e-12 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity41.9%

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

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

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

        \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\frac{t}{\cos k}} \cdot \sqrt{\frac{t}{\cos k}}\right)} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      5. add-sqr-sqrt93.9%

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

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

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

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

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

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

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

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

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

Alternative 7: 55.5% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.12 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{2}{\frac{t}{\cos k}}}{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.12e-12)
   (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0))
   (/ (/ 2.0 (/ t (cos k))) (pow (* k (/ (sin k) l)) 2.0))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.12e-12) {
		tmp = 2.0 * pow((k * ((k / l) * sqrt(t))), -2.0);
	} else {
		tmp = (2.0 / (t / cos(k))) / pow((k * (sin(k) / l)), 2.0);
	}
	return tmp;
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: tmp
    if (k <= 1.12d-12) then
        tmp = 2.0d0 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
    else
        tmp = (2.0d0 / (t / cos(k))) / ((k * (sin(k) / l)) ** 2.0d0)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.12e-12) {
		tmp = 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
	} else {
		tmp = (2.0 / (t / Math.cos(k))) / Math.pow((k * (Math.sin(k) / l)), 2.0);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.12e-12:
		tmp = 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
	else:
		tmp = (2.0 / (t / math.cos(k))) / math.pow((k * (math.sin(k) / l)), 2.0)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.12e-12)
		tmp = Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0));
	else
		tmp = Float64(Float64(2.0 / Float64(t / cos(k))) / (Float64(k * Float64(sin(k) / l)) ^ 2.0));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.12e-12)
		tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
	else
		tmp = (2.0 / (t / cos(k))) / ((k * (sin(k) / l)) ^ 2.0);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.12e-12], N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(t / N[Cos[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.12 \cdot 10^{-12}:\\
\;\;\;\;2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}\\

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


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

    1. Initial program 38.1%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr17.2%

      \[\leadsto \frac{2}{\color{blue}{{\left(\frac{k}{t} \cdot \left(\frac{{t}^{1.5}}{\ell} \cdot \sqrt{\sin k \cdot \tan k}\right)\right)}^{2} + \left(\sin k \cdot \left(\tan k \cdot \left({t}^{3} \cdot {\ell}^{-2}\right)\right)\right) \cdot 0}} \]
    4. Step-by-step derivation
      1. mul0-rgt33.6%

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 49.3%

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

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

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

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

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

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

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

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

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

    if 1.1200000000000001e-12 < k

    1. Initial program 31.9%

      \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
    2. Add Preprocessing
    3. Applied egg-rr7.4%

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

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

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

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

      \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
    6. Taylor expanded in k around inf 42.0%

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

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

      \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity41.9%

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

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

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

        \[\leadsto 1 \cdot \frac{2}{\color{blue}{\left(\sqrt{\frac{t}{\cos k}} \cdot \sqrt{\frac{t}{\cos k}}\right)} \cdot {\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      5. add-sqr-sqrt93.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot \cos k}{t}}}{{\left(k \cdot \frac{\sin k}{\ell}\right)}^{2}} \]
      2. *-un-lft-identity94.0%

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

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

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

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

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

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

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

Alternative 8: 99.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := k \cdot \frac{\sin k}{\ell}\\ \frac{\cos k}{t\_1} \cdot \frac{\frac{2}{t}}{t\_1} \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (* k (/ (sin k) l)))) (* (/ (cos k) t_1) (/ (/ 2.0 t) t_1))))
double code(double t, double l, double k) {
	double t_1 = k * (sin(k) / l);
	return (cos(k) / t_1) * ((2.0 / t) / t_1);
}
real(8) function code(t, l, k)
    real(8), intent (in) :: t
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8) :: t_1
    t_1 = k * (sin(k) / l)
    code = (cos(k) / t_1) * ((2.0d0 / t) / t_1)
end function
public static double code(double t, double l, double k) {
	double t_1 = k * (Math.sin(k) / l);
	return (Math.cos(k) / t_1) * ((2.0 / t) / t_1);
}
def code(t, l, k):
	t_1 = k * (math.sin(k) / l)
	return (math.cos(k) / t_1) * ((2.0 / t) / t_1)
function code(t, l, k)
	t_1 = Float64(k * Float64(sin(k) / l))
	return Float64(Float64(cos(k) / t_1) * Float64(Float64(2.0 / t) / t_1))
end
function tmp = code(t, l, k)
	t_1 = k * (sin(k) / l);
	tmp = (cos(k) / t_1) * ((2.0 / t) / t_1);
end
code[t_, l_, k_] := Block[{t$95$1 = N[(k * N[(N[Sin[k], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Cos[k], $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[(2.0 / t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := k \cdot \frac{\sin k}{\ell}\\
\frac{\cos k}{t\_1} \cdot \frac{\frac{2}{t}}{t\_1}
\end{array}
\end{array}
Derivation
  1. Initial program 36.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr14.6%

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Taylor expanded in k around inf 47.4%

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

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

    \[\leadsto \frac{2}{{\color{blue}{\left(\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \sqrt{\frac{t}{\cos k}}\right)}}^{2}} \]
  9. Step-by-step derivation
    1. *-un-lft-identity47.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{2}{t} \cdot \cos k}{\color{blue}{\left(k \cdot \frac{\sin k}{\ell}\right) \cdot \left(k \cdot \frac{\sin k}{\ell}\right)}} \]
    2. times-frac99.6%

      \[\leadsto \color{blue}{\frac{\frac{2}{t}}{k \cdot \frac{\sin k}{\ell}} \cdot \frac{\cos k}{k \cdot \frac{\sin k}{\ell}}} \]
  14. Applied egg-rr99.6%

    \[\leadsto \color{blue}{\frac{\frac{2}{t}}{k \cdot \frac{\sin k}{\ell}} \cdot \frac{\cos k}{k \cdot \frac{\sin k}{\ell}}} \]
  15. Final simplification99.6%

    \[\leadsto \frac{\cos k}{k \cdot \frac{\sin k}{\ell}} \cdot \frac{\frac{2}{t}}{k \cdot \frac{\sin k}{\ell}} \]
  16. Add Preprocessing

Alternative 9: 37.4% accurate, 2.0× speedup?

\[\begin{array}{l} \\ 2 \cdot {\left(k \cdot \left(k \cdot \frac{\sqrt{t}}{\ell}\right)\right)}^{-2} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* 2.0 (pow (* k (* k (/ (sqrt t) l))) -2.0)))
double code(double t, double l, double k) {
	return 2.0 * pow((k * (k * (sqrt(t) / l))), -2.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 * ((k * (k * (sqrt(t) / l))) ** (-2.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 * Math.pow((k * (k * (Math.sqrt(t) / l))), -2.0);
}
def code(t, l, k):
	return 2.0 * math.pow((k * (k * (math.sqrt(t) / l))), -2.0)
function code(t, l, k)
	return Float64(2.0 * (Float64(k * Float64(k * Float64(sqrt(t) / l))) ^ -2.0))
end
function tmp = code(t, l, k)
	tmp = 2.0 * ((k * (k * (sqrt(t) / l))) ^ -2.0);
end
code[t_, l_, k_] := N[(2.0 * N[Power[N[(k * N[(k * N[(N[Sqrt[t], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot {\left(k \cdot \left(k \cdot \frac{\sqrt{t}}{\ell}\right)\right)}^{-2}
\end{array}
Derivation
  1. Initial program 36.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr14.6%

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Taylor expanded in k around inf 47.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 38.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ 2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (* 2.0 (pow (* k (* (/ k l) (sqrt t))) -2.0)))
double code(double t, double l, double k) {
	return 2.0 * pow((k * ((k / l) * sqrt(t))), -2.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 * ((k * ((k / l) * sqrt(t))) ** (-2.0d0))
end function
public static double code(double t, double l, double k) {
	return 2.0 * Math.pow((k * ((k / l) * Math.sqrt(t))), -2.0);
}
def code(t, l, k):
	return 2.0 * math.pow((k * ((k / l) * math.sqrt(t))), -2.0)
function code(t, l, k)
	return Float64(2.0 * (Float64(k * Float64(Float64(k / l) * sqrt(t))) ^ -2.0))
end
function tmp = code(t, l, k)
	tmp = 2.0 * ((k * ((k / l) * sqrt(t))) ^ -2.0);
end
code[t_, l_, k_] := N[(2.0 * N[Power[N[(k * N[(N[(k / l), $MachinePrecision] * N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot {\left(k \cdot \left(\frac{k}{\ell} \cdot \sqrt{t}\right)\right)}^{-2}
\end{array}
Derivation
  1. Initial program 36.4%

    \[\frac{2}{\left(\left(\frac{{t}^{3}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot \left(\left(1 + {\left(\frac{k}{t}\right)}^{2}\right) - 1\right)} \]
  2. Add Preprocessing
  3. Applied egg-rr14.6%

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

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

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

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

    \[\leadsto \frac{2}{\color{blue}{{\left(\left(\frac{k}{t} \cdot \frac{{t}^{1.5}}{\ell}\right) \cdot \sqrt{\sin k \cdot \tan k}\right)}^{2}}} \]
  6. Taylor expanded in k around inf 47.4%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 63.7% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{\left(2 \cdot {k}^{-4}\right) \cdot {\ell}^{2}}{t} \end{array} \]
(FPCore (t l k) :precision binary64 (/ (* (* 2.0 (pow k -4.0)) (pow l 2.0)) t))
double code(double t, double l, double k) {
	return ((2.0 * pow(k, -4.0)) * pow(l, 2.0)) / t;
}
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 * (k ** (-4.0d0))) * (l ** 2.0d0)) / t
end function
public static double code(double t, double l, double k) {
	return ((2.0 * Math.pow(k, -4.0)) * Math.pow(l, 2.0)) / t;
}
def code(t, l, k):
	return ((2.0 * math.pow(k, -4.0)) * math.pow(l, 2.0)) / t
function code(t, l, k)
	return Float64(Float64(Float64(2.0 * (k ^ -4.0)) * (l ^ 2.0)) / t)
end
function tmp = code(t, l, k)
	tmp = ((2.0 * (k ^ -4.0)) * (l ^ 2.0)) / t;
end
code[t_, l_, k_] := N[(N[(N[(2.0 * N[Power[k, -4.0], $MachinePrecision]), $MachinePrecision] * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(2 \cdot {k}^{-4}\right) \cdot {\ell}^{2}}{t}
\end{array}
Derivation
  1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.7% accurate, 3.8× speedup?

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

\\
\frac{1}{\frac{t}{2 \cdot {k}^{-4}}} \cdot \left(\ell \cdot \ell\right)
\end{array}
Derivation
  1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 63.7% accurate, 3.8× speedup?

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

\\
\left(\ell \cdot \ell\right) \cdot \left(\frac{2}{t} \cdot {k}^{-4}\right)
\end{array}
Derivation
  1. Initial program 36.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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