Toniolo and Linder, Equation (10-)

Percentage Accurate: 36.3% → 98.9%
Time: 19.2s
Alternatives: 10
Speedup: 21.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 36.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: 98.9% accurate, 2.0× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
  5. Simplified74.6%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
  7. Applied egg-rr82.9%

    \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
  8. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
    2. times-fracN/A

      \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
    3. clear-numN/A

      \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
    4. un-div-invN/A

      \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
    9. un-div-invN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
    12. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
    14. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    16. tan-lowering-tan.f6495.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
  9. Applied egg-rr95.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\left(\frac{k}{2 \cdot \ell} \cdot \sin k\right) \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\left(\frac{k}{2 \cdot \ell} \cdot \sin k\right), \color{blue}{\left(\tan k \cdot t\right)}\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{k}{2 \cdot \ell}\right), \sin k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \left(2 \cdot \ell\right)\right), \sin k\right), \left(\tan \color{blue}{k} \cdot t\right)\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \left(\ell \cdot 2\right)\right), \sin k\right), \left(\tan k \cdot t\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\ell, 2\right)\right), \sin k\right), \left(\tan k \cdot t\right)\right)\right) \]
    8. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\ell, 2\right)\right), \mathsf{sin.f64}\left(k\right)\right), \left(\tan k \cdot t\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\ell, 2\right)\right), \mathsf{sin.f64}\left(k\right)\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right) \]
    10. tan-lowering-tan.f6499.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(k, \mathsf{*.f64}\left(\ell, 2\right)\right), \mathsf{sin.f64}\left(k\right)\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right) \]
  11. Applied egg-rr99.0%

    \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\left(\frac{k}{\ell \cdot 2} \cdot \sin k\right) \cdot \left(\tan k \cdot t\right)}} \]
  12. Add Preprocessing

Alternative 2: 82.0% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 4.2 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{elif}\;k \leq 9.8 \cdot 10^{+153}:\\ \;\;\;\;\ell \cdot \frac{\frac{\ell \cdot 2}{\sin k \cdot \left(\tan k \cdot t\right)}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k} \cdot \frac{\frac{\ell \cdot \ell}{t \cdot \left(\sin k \cdot \tan k\right)}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 4.2e-144)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (if (<= k 9.8e+153)
     (* l (/ (/ (* l 2.0) (* (sin k) (* (tan k) t))) (* k k)))
     (* (/ 2.0 k) (/ (/ (* l l) (* t (* (sin k) (tan k)))) k)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 4.2e-144) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else if (k <= 9.8e+153) {
		tmp = l * (((l * 2.0) / (sin(k) * (tan(k) * t))) / (k * k));
	} else {
		tmp = (2.0 / k) * (((l * l) / (t * (sin(k) * tan(k)))) / 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 <= 4.2d-144) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else if (k <= 9.8d+153) then
        tmp = l * (((l * 2.0d0) / (sin(k) * (tan(k) * t))) / (k * k))
    else
        tmp = (2.0d0 / k) * (((l * l) / (t * (sin(k) * tan(k)))) / k)
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 4.2e-144) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else if (k <= 9.8e+153) {
		tmp = l * (((l * 2.0) / (Math.sin(k) * (Math.tan(k) * t))) / (k * k));
	} else {
		tmp = (2.0 / k) * (((l * l) / (t * (Math.sin(k) * Math.tan(k)))) / k);
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 4.2e-144:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	elif k <= 9.8e+153:
		tmp = l * (((l * 2.0) / (math.sin(k) * (math.tan(k) * t))) / (k * k))
	else:
		tmp = (2.0 / k) * (((l * l) / (t * (math.sin(k) * math.tan(k)))) / k)
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 4.2e-144)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	elseif (k <= 9.8e+153)
		tmp = Float64(l * Float64(Float64(Float64(l * 2.0) / Float64(sin(k) * Float64(tan(k) * t))) / Float64(k * k)));
	else
		tmp = Float64(Float64(2.0 / k) * Float64(Float64(Float64(l * l) / Float64(t * Float64(sin(k) * tan(k)))) / k));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 4.2e-144)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	elseif (k <= 9.8e+153)
		tmp = l * (((l * 2.0) / (sin(k) * (tan(k) * t))) / (k * k));
	else
		tmp = (2.0 / k) * (((l * l) / (t * (sin(k) * tan(k)))) / k);
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 4.2e-144], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 9.8e+153], N[(l * N[(N[(N[(l * 2.0), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l * l), $MachinePrecision] / N[(t * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;k \leq 9.8 \cdot 10^{+153}:\\
\;\;\;\;\ell \cdot \frac{\frac{\ell \cdot 2}{\sin k \cdot \left(\tan k \cdot t\right)}}{k \cdot k}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if k < 4.2000000000000002e-144

    1. Initial program 41.4%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified80.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr88.5%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6482.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified82.3%

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

    if 4.2000000000000002e-144 < k < 9.80000000000000003e153

    1. Initial program 19.7%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified77.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr89.5%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k \cdot k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right), \color{blue}{\left(k \cdot k\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{\left(\sin k \cdot \tan k\right) \cdot t}\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right), \left(k \cdot k\right)\right)\right) \]
      9. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      11. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      13. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      14. *-lowering-*.f6495.9%

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right) \]
    9. Applied egg-rr95.9%

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

    if 9.80000000000000003e153 < k

    1. Initial program 31.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified50.5%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\left(\left(\ell \cdot \ell\right) \cdot \frac{\frac{\cos k}{t}}{{\sin k}^{2}}\right), \color{blue}{k}\right)\right) \]
    7. Applied egg-rr60.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 4.2 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{elif}\;k \leq 9.8 \cdot 10^{+153}:\\ \;\;\;\;\ell \cdot \frac{\frac{\ell \cdot 2}{\sin k \cdot \left(\tan k \cdot t\right)}}{k \cdot k}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{k} \cdot \frac{\frac{\ell \cdot \ell}{t \cdot \left(\sin k \cdot \tan k\right)}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.5% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 5.2 \cdot 10^{-17}:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{k} \cdot \frac{\ell \cdot 2}{\left(k \cdot t\right) \cdot \left(\sin k \cdot \tan k\right)}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 5.2e-17)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (* (/ l k) (/ (* l 2.0) (* (* k t) (* (sin k) (tan k)))))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.2e-17) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = (l / k) * ((l * 2.0) / ((k * t) * (sin(k) * tan(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 <= 5.2d-17) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else
        tmp = (l / k) * ((l * 2.0d0) / ((k * t) * (sin(k) * tan(k))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 5.2e-17) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = (l / k) * ((l * 2.0) / ((k * t) * (Math.sin(k) * Math.tan(k))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 5.2e-17:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	else:
		tmp = (l / k) * ((l * 2.0) / ((k * t) * (math.sin(k) * math.tan(k))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 5.2e-17)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	else
		tmp = Float64(Float64(l / k) * Float64(Float64(l * 2.0) / Float64(Float64(k * t) * Float64(sin(k) * tan(k)))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 5.2e-17)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	else
		tmp = (l / k) * ((l * 2.0) / ((k * t) * (sin(k) * tan(k))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 5.2e-17], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l / k), $MachinePrecision] * N[(N[(l * 2.0), $MachinePrecision] / N[(N[(k * t), $MachinePrecision] * N[(N[Sin[k], $MachinePrecision] * N[Tan[k], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 36.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified78.3%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr89.2%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6485.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified85.3%

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

    if 5.20000000000000006e-17 < k

    1. Initial program 26.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified66.1%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr68.4%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. times-fracN/A

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}\right), \color{blue}{\left(\frac{\ell}{k}\right)}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}{k}\right), \left(\frac{\ell}{k}\right)\right) \]
      4. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2 \cdot \ell}{\left(\sin k \cdot \tan k\right) \cdot t}}{k}\right), \left(\frac{\ell}{k}\right)\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2 \cdot \ell}{k \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right), \left(\frac{\color{blue}{\ell}}{k}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), \left(k \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right)\right), \left(\frac{\color{blue}{\ell}}{k}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \left(t \cdot \left(\sin k \cdot \tan k\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot t\right) \cdot \left(\sin k \cdot \tan k\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\left(k \cdot t\right), \left(\sin k \cdot \tan k\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, t\right), \left(\sin k \cdot \tan k\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, t\right), \mathsf{*.f64}\left(\sin k, \tan k\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      13. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \tan k\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      14. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right)\right), \left(\frac{\ell}{k}\right)\right) \]
      15. /-lowering-/.f6492.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(k, t\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{tan.f64}\left(k\right)\right)\right)\right), \mathsf{/.f64}\left(\ell, \color{blue}{k}\right)\right) \]
    9. Applied egg-rr92.1%

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

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

Alternative 4: 80.9% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 4 \cdot 10^{-144}:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{\ell \cdot 2}{\sin k \cdot \left(\tan k \cdot t\right)}}{k \cdot k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 4e-144)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (* l (/ (/ (* l 2.0) (* (sin k) (* (tan k) t))) (* k k)))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 4e-144) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = l * (((l * 2.0) / (sin(k) * (tan(k) * t))) / (k * 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 <= 4d-144) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else
        tmp = l * (((l * 2.0d0) / (sin(k) * (tan(k) * t))) / (k * k))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 4e-144) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = l * (((l * 2.0) / (Math.sin(k) * (Math.tan(k) * t))) / (k * k));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 4e-144:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	else:
		tmp = l * (((l * 2.0) / (math.sin(k) * (math.tan(k) * t))) / (k * k))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 4e-144)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	else
		tmp = Float64(l * Float64(Float64(Float64(l * 2.0) / Float64(sin(k) * Float64(tan(k) * t))) / Float64(k * k)));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 4e-144)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	else
		tmp = l * (((l * 2.0) / (sin(k) * (tan(k) * t))) / (k * k));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 4e-144], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[(N[(N[(l * 2.0), $MachinePrecision] / N[(N[Sin[k], $MachinePrecision] * N[(N[Tan[k], $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 41.4%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified80.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr88.5%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6482.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified82.3%

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

    if 3.9999999999999998e-144 < k

    1. Initial program 23.9%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified67.3%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr75.9%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k \cdot k}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right), \color{blue}{\left(k \cdot k\right)}\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      6. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{\left(\sin k \cdot \tan k\right) \cdot t}\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot \ell\right), \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right), \left(\color{blue}{k} \cdot k\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(\sin k \cdot \tan k\right) \cdot t\right)\right), \left(k \cdot k\right)\right)\right) \]
      9. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      11. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\tan k \cdot t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      13. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right), \left(k \cdot k\right)\right)\right) \]
      14. *-lowering-*.f6480.4%

        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right), \mathsf{*.f64}\left(k, \color{blue}{k}\right)\right)\right) \]
    9. Applied egg-rr80.4%

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

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

Alternative 5: 75.7% accurate, 3.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.2:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{k}{\frac{\frac{\ell \cdot 2}{\frac{k}{\ell}}}{\frac{k}{\frac{\frac{\cos k}{t}}{k}}}}}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.2)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (/ 1.0 (/ k (/ (/ (* l 2.0) (/ k l)) (/ k (/ (/ (cos k) t) k)))))))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.2) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = 1.0 / (k / (((l * 2.0) / (k / l)) / (k / ((cos(k) / t) / 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.2d0) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else
        tmp = 1.0d0 / (k / (((l * 2.0d0) / (k / l)) / (k / ((cos(k) / t) / k))))
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.2) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = 1.0 / (k / (((l * 2.0) / (k / l)) / (k / ((Math.cos(k) / t) / k))));
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.2:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	else:
		tmp = 1.0 / (k / (((l * 2.0) / (k / l)) / (k / ((math.cos(k) / t) / k))))
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.2)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	else
		tmp = Float64(1.0 / Float64(k / Float64(Float64(Float64(l * 2.0) / Float64(k / l)) / Float64(k / Float64(Float64(cos(k) / t) / k)))));
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.2)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	else
		tmp = 1.0 / (k / (((l * 2.0) / (k / l)) / (k / ((cos(k) / t) / k))));
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.2], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(k / N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.2:\\
\;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\

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


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

    1. Initial program 35.4%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr89.6%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6485.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified85.2%

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

    if 1.19999999999999996 < k

    1. Initial program 28.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified64.1%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \color{blue}{\left({k}^{2}\right)}\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \left(k \cdot k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. *-lowering-*.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    8. Simplified48.6%

      \[\leadsto \frac{\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{\cos k}{t}}{\color{blue}{k \cdot k}}}{k \cdot k} \]
    9. Step-by-step derivation
      1. times-fracN/A

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

        \[\leadsto \frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k} \cdot \frac{\frac{\cos k}{t}}{k \cdot k}}{\color{blue}{k}} \]
      3. clear-numN/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{k}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k} \cdot \frac{\frac{\cos k}{t}}{k \cdot k}}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{2 \cdot \left(\ell \cdot \ell\right)}{k} \cdot \frac{\frac{\cos k}{t}}{k \cdot k}\right)}\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \left(\ell \cdot \ell\right)}{k} \cdot \frac{1}{\color{blue}{\frac{k \cdot k}{\frac{\cos k}{t}}}}\right)\right)\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \left(\frac{\frac{2 \cdot \left(\ell \cdot \ell\right)}{k}}{\color{blue}{\frac{k \cdot k}{\frac{\cos k}{t}}}}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(\frac{\left(2 \cdot \ell\right) \cdot \ell}{k}\right), \left(\frac{\color{blue}{k} \cdot k}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      10. associate-/l*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{\ell}{k}\right), \left(\frac{\color{blue}{k \cdot k}}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      11. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(\left(2 \cdot \ell\right) \cdot \frac{1}{\frac{k}{\ell}}\right), \left(\frac{k \cdot \color{blue}{k}}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      12. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(\frac{2 \cdot \ell}{\frac{k}{\ell}}\right), \left(\frac{\color{blue}{k \cdot k}}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      13. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot 2\right), \left(\frac{k}{\ell}\right)\right), \left(\frac{\color{blue}{k} \cdot k}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, 2\right), \left(\frac{k}{\ell}\right)\right), \left(\frac{\color{blue}{k} \cdot k}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      16. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, 2\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(\frac{k \cdot \color{blue}{k}}{\frac{\cos k}{t}}\right)\right)\right)\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, 2\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(\frac{1}{\color{blue}{\frac{\frac{\cos k}{t}}{k \cdot k}}}\right)\right)\right)\right) \]
      18. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, 2\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(\frac{1}{\frac{\frac{\frac{\cos k}{t}}{k}}{\color{blue}{k}}}\right)\right)\right)\right) \]
      19. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, 2\right), \mathsf{/.f64}\left(k, \ell\right)\right), \left(\frac{k}{\color{blue}{\frac{\frac{\cos k}{t}}{k}}}\right)\right)\right)\right) \]
    10. Applied egg-rr51.6%

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

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

Alternative 6: 75.7% accurate, 3.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 1.2:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot 2}{\frac{k}{\ell}}}{\frac{k}{\frac{\frac{\cos k}{t}}{k}}}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 1.2)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (/ (/ (/ (* l 2.0) (/ k l)) (/ k (/ (/ (cos k) t) k))) k)))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.2) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = (((l * 2.0) / (k / l)) / (k / ((cos(k) / t) / k))) / 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.2d0) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else
        tmp = (((l * 2.0d0) / (k / l)) / (k / ((cos(k) / t) / k))) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 1.2) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = (((l * 2.0) / (k / l)) / (k / ((Math.cos(k) / t) / k))) / k;
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 1.2:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	else:
		tmp = (((l * 2.0) / (k / l)) / (k / ((math.cos(k) / t) / k))) / k
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 1.2)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	else
		tmp = Float64(Float64(Float64(Float64(l * 2.0) / Float64(k / l)) / Float64(k / Float64(Float64(cos(k) / t) / k))) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 1.2)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	else
		tmp = (((l * 2.0) / (k / l)) / (k / ((cos(k) / t) / k))) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 1.2], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(l * 2.0), $MachinePrecision] / N[(k / l), $MachinePrecision]), $MachinePrecision] / N[(k / N[(N[(N[Cos[k], $MachinePrecision] / t), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 1.2:\\
\;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\

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


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

    1. Initial program 35.4%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr89.6%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6485.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified85.2%

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

    if 1.19999999999999996 < k

    1. Initial program 28.6%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified64.1%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \color{blue}{\left({k}^{2}\right)}\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    7. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \left(k \cdot k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
      2. *-lowering-*.f6448.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{cos.f64}\left(k\right), t\right), \mathsf{*.f64}\left(k, k\right)\right)\right), \mathsf{*.f64}\left(k, k\right)\right) \]
    8. Simplified48.6%

      \[\leadsto \frac{\left(2 \cdot \left(\ell \cdot \ell\right)\right) \cdot \frac{\frac{\cos k}{t}}{\color{blue}{k \cdot k}}}{k \cdot k} \]
    9. Step-by-step derivation
      1. times-fracN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot \left(\ell \cdot \ell\right)}{k} \cdot \frac{\frac{\cos k}{t}}{k \cdot k}\right), \color{blue}{k}\right) \]
    10. Applied egg-rr51.6%

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

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

Alternative 7: 74.8% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 390.0)
   (/ (/ l k) (/ k (/ (* l 2.0) (* k (* k t)))))
   (/ (/ (* (/ (* l l) t) -0.6666666666666666) k) k)))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / 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 <= 390.0d0) then
        tmp = (l / k) / (k / ((l * 2.0d0) / (k * (k * t))))
    else
        tmp = ((((l * l) / t) * (-0.6666666666666666d0)) / k) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 390.0:
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))))
	else:
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 390.0)
		tmp = Float64(Float64(l / k) / Float64(k / Float64(Float64(l * 2.0) / Float64(k * Float64(k * t)))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(l * l) / t) * -0.6666666666666666) / k) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 390.0)
		tmp = (l / k) / (k / ((l * 2.0) / (k * (k * t))));
	else
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 390.0], N[(N[(l / k), $MachinePrecision] / N[(k / N[(N[(l * 2.0), $MachinePrecision] / N[(k * N[(k * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 390:\\
\;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\


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

    1. Initial program 35.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(2 \cdot {\ell}^{2}\right) \cdot \frac{\cos k}{t \cdot {\sin k}^{2}}\right), \color{blue}{\left({k}^{2}\right)}\right) \]
    5. Simplified78.7%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{\frac{\cos k}{t}}{{\sin k}^{2}} \cdot \left(2 \cdot \ell\right)\right), \ell\right), \mathsf{*.f64}\left(\color{blue}{k}, k\right)\right) \]
    7. Applied egg-rr89.6%

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right) \cdot \ell}}{k \cdot k} \]
    8. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\ell \cdot \left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}{\color{blue}{k} \cdot k} \]
      2. times-fracN/A

        \[\leadsto \frac{\ell}{k} \cdot \color{blue}{\frac{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}{k}} \]
      3. clear-numN/A

        \[\leadsto \frac{\ell}{k} \cdot \frac{1}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{\frac{\ell}{k}}{\color{blue}{\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\ell}{k}\right), \color{blue}{\left(\frac{k}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \left(\frac{\color{blue}{k}}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \color{blue}{\left(\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t} \cdot \left(2 \cdot \ell\right)\right)}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\left(2 \cdot \ell\right) \cdot \color{blue}{\frac{1}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      9. un-div-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \left(\frac{2 \cdot \ell}{\color{blue}{\left(\sin k \cdot \tan k\right) \cdot t}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\left(2 \cdot \ell\right), \color{blue}{\left(\left(\sin k \cdot \tan k\right) \cdot t\right)}\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\color{blue}{\left(\sin k \cdot \tan k\right)} \cdot t\right)\right)\right)\right) \]
      12. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\sin k \cdot \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\sin k, \color{blue}{\left(\tan k \cdot t\right)}\right)\right)\right)\right) \]
      14. sin-lowering-sin.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \left(\color{blue}{\tan k} \cdot t\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\tan k, \color{blue}{t}\right)\right)\right)\right)\right) \]
      16. tan-lowering-tan.f6497.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(k\right), \mathsf{*.f64}\left(\mathsf{tan.f64}\left(k\right), t\right)\right)\right)\right)\right) \]
    9. Applied egg-rr97.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \color{blue}{\left({k}^{2} \cdot t\right)}\right)\right)\right) \]
    11. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(\left(k \cdot k\right) \cdot t\right)\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \left(k \cdot \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \color{blue}{\left(k \cdot t\right)}\right)\right)\right)\right) \]
      4. *-lowering-*.f6485.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, k\right), \mathsf{/.f64}\left(k, \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \ell\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \color{blue}{t}\right)\right)\right)\right)\right) \]
    12. Simplified85.3%

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

    if 390 < k

    1. Initial program 29.0%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{2}{t}}{\frac{\frac{t \cdot t}{\ell}}{\ell}}}{\sin k}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)}, \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot {t}^{3}}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left({t}^{3} \cdot k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left({t}^{3}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot {t}^{2}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left({t}^{2}\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      12. *-lowering-*.f6429.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    7. Simplified29.0%

      \[\leadsto \frac{\frac{\color{blue}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{\left(t \cdot \left(t \cdot t\right)\right) \cdot k}}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{\frac{-2}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{{k}^{2} \cdot {\ell}^{2}}{t} \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      2. associate-/l*N/A

        \[\leadsto \frac{\left({k}^{2} \cdot \frac{{\ell}^{2}}{t}\right) \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      3. associate-*r*N/A

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

        \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right) + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      5. +-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
    10. Simplified14.2%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot \left(\left(k \cdot k\right) \cdot -0.6666666666666666 + 2\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
    11. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-2}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{\frac{\frac{-2}{3} \cdot {\ell}^{2}}{t}}{\color{blue}{{k}^{2}}} \]
      3. associate-*r/N/A

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

        \[\leadsto \frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot \color{blue}{k}} \]
      5. associate-/r*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k}\right), \color{blue}{k}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right), k\right), k\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-2}{3}\right), k\right), k\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-2}{3}\right), k\right), k\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      12. *-lowering-*.f6449.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
    13. Simplified49.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\frac{\frac{\ell}{k}}{\frac{k}{\frac{\ell \cdot 2}{k \cdot \left(k \cdot t\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 73.1% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\frac{\ell}{k \cdot t}}{k}}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 390.0)
   (* l (* (/ 2.0 k) (/ (/ (/ l (* k t)) k) k)))
   (/ (/ (* (/ (* l l) t) -0.6666666666666666) k) k)))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = l * ((2.0 / k) * (((l / (k * t)) / k) / k));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / 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 <= 390.0d0) then
        tmp = l * ((2.0d0 / k) * (((l / (k * t)) / k) / k))
    else
        tmp = ((((l * l) / t) * (-0.6666666666666666d0)) / k) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = l * ((2.0 / k) * (((l / (k * t)) / k) / k));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 390.0:
		tmp = l * ((2.0 / k) * (((l / (k * t)) / k) / k))
	else:
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 390.0)
		tmp = Float64(l * Float64(Float64(2.0 / k) * Float64(Float64(Float64(l / Float64(k * t)) / k) / k)));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(l * l) / t) * -0.6666666666666666) / k) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 390.0)
		tmp = l * ((2.0 / k) * (((l / (k * t)) / k) / k));
	else
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 390.0], N[(l * N[(N[(2.0 / k), $MachinePrecision] * N[(N[(N[(l / N[(k * t), $MachinePrecision]), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 390:\\
\;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\frac{\ell}{k \cdot t}}{k}}{k}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\


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

    1. Initial program 35.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6464.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified64.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{\frac{t}{\ell}}\right), \color{blue}{\ell}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      8. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(k \cdot {k}^{3}\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \left({k}^{3}\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      10. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      13. /-lowering-/.f6474.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \ell\right) \]
    7. Applied egg-rr74.1%

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot \left(k \cdot \left(k \cdot k\right)\right)}}{\frac{t}{\ell}} \cdot \ell} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k \cdot \left(k \cdot \left(k \cdot k\right)\right)} \cdot \frac{1}{\frac{t}{\ell}}\right), \ell\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{k}}{k \cdot \left(k \cdot k\right)} \cdot \frac{1}{\frac{t}{\ell}}\right), \ell\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{k} \cdot 1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\frac{2}{k} \cdot 1\right) \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      5. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{1}{\frac{\ell}{t}}}\right), \ell\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\frac{k \cdot \left(k \cdot k\right)}{\frac{\ell}{t}}}\right), \ell\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right), \ell\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{2}{k}\right), \left(\frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\right), \ell\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \left(\frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\right), \ell\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      14. *-lowering-*.f6478.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \ell\right) \]
    9. Applied egg-rr78.8%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \left(\frac{\frac{\frac{\ell}{t}}{k}}{k \cdot k}\right)\right), \ell\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \left(\frac{\frac{\frac{\frac{\ell}{t}}{k}}{k}}{k}\right)\right), \ell\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\left(\frac{\frac{\frac{\ell}{t}}{k}}{k}\right), k\right)\right), \ell\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\frac{\ell}{t}}{k}\right), k\right), k\right)\right), \ell\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{\ell}{k \cdot t}\right), k\right), k\right)\right), \ell\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \left(k \cdot t\right)\right), k\right), k\right)\right), \ell\right) \]
      7. *-lowering-*.f6483.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{*.f64}\left(k, t\right)\right), k\right), k\right)\right), \ell\right) \]
    11. Applied egg-rr83.5%

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

    if 390 < k

    1. Initial program 29.0%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{2}{t}}{\frac{\frac{t \cdot t}{\ell}}{\ell}}}{\sin k}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)}, \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot {t}^{3}}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left({t}^{3} \cdot k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left({t}^{3}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot {t}^{2}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left({t}^{2}\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      12. *-lowering-*.f6429.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    7. Simplified29.0%

      \[\leadsto \frac{\frac{\color{blue}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{\left(t \cdot \left(t \cdot t\right)\right) \cdot k}}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{\frac{-2}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{{k}^{2} \cdot {\ell}^{2}}{t} \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      2. associate-/l*N/A

        \[\leadsto \frac{\left({k}^{2} \cdot \frac{{\ell}^{2}}{t}\right) \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      3. associate-*r*N/A

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

        \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right) + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      5. +-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
    10. Simplified14.2%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot \left(\left(k \cdot k\right) \cdot -0.6666666666666666 + 2\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
    11. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-2}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{\frac{\frac{-2}{3} \cdot {\ell}^{2}}{t}}{\color{blue}{{k}^{2}}} \]
      3. associate-*r/N/A

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

        \[\leadsto \frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot \color{blue}{k}} \]
      5. associate-/r*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k}\right), \color{blue}{k}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right), k\right), k\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-2}{3}\right), k\right), k\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-2}{3}\right), k\right), k\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      12. *-lowering-*.f6449.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
    13. Simplified49.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\frac{\ell}{k \cdot t}}{k}}{k}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 69.7% accurate, 21.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (if (<= k 390.0)
   (* l (* (/ 2.0 k) (/ (/ l t) (* k (* k k)))))
   (/ (/ (* (/ (* l l) t) -0.6666666666666666) k) k)))
double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = l * ((2.0 / k) * ((l / t) / (k * (k * k))));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / 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 <= 390.0d0) then
        tmp = l * ((2.0d0 / k) * ((l / t) / (k * (k * k))))
    else
        tmp = ((((l * l) / t) * (-0.6666666666666666d0)) / k) / k
    end if
    code = tmp
end function
public static double code(double t, double l, double k) {
	double tmp;
	if (k <= 390.0) {
		tmp = l * ((2.0 / k) * ((l / t) / (k * (k * k))));
	} else {
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	}
	return tmp;
}
def code(t, l, k):
	tmp = 0
	if k <= 390.0:
		tmp = l * ((2.0 / k) * ((l / t) / (k * (k * k))))
	else:
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k
	return tmp
function code(t, l, k)
	tmp = 0.0
	if (k <= 390.0)
		tmp = Float64(l * Float64(Float64(2.0 / k) * Float64(Float64(l / t) / Float64(k * Float64(k * k)))));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(l * l) / t) * -0.6666666666666666) / k) / k);
	end
	return tmp
end
function tmp_2 = code(t, l, k)
	tmp = 0.0;
	if (k <= 390.0)
		tmp = l * ((2.0 / k) * ((l / t) / (k * (k * k))));
	else
		tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
	end
	tmp_2 = tmp;
end
code[t_, l_, k_] := If[LessEqual[k, 390.0], N[(l * N[(N[(2.0 / k), $MachinePrecision] * N[(N[(l / t), $MachinePrecision] / N[(k * N[(k * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;k \leq 390:\\
\;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\


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

    1. Initial program 35.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{4}\right), \color{blue}{\left(\frac{t}{{\ell}^{2}}\right)}\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\left({k}^{\left(2 \cdot 2\right)}\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      4. pow-sqrN/A

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

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({k}^{2}\right), \left({k}^{2}\right)\right), \left(\frac{\color{blue}{t}}{{\ell}^{2}}\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(k \cdot k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left({k}^{2}\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \left(k \cdot k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \left(\frac{t}{{\ell}^{2}}\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
      12. *-lowering-*.f6464.4%

        \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(k, k\right), \mathsf{*.f64}\left(k, k\right)\right), \mathsf{/.f64}\left(t, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
    5. Simplified64.4%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}}{\frac{t}{\ell}}\right), \color{blue}{\ell}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{2}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(\left(k \cdot k\right) \cdot \left(k \cdot k\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(k \cdot \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      8. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \left(k \cdot {k}^{3}\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \left({k}^{3}\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      10. cube-unmultN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \left(k \cdot k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \left(\frac{t}{\ell}\right)\right), \ell\right) \]
      13. /-lowering-/.f6474.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(2, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \mathsf{/.f64}\left(t, \ell\right)\right), \ell\right) \]
    7. Applied egg-rr74.1%

      \[\leadsto \color{blue}{\frac{\frac{2}{k \cdot \left(k \cdot \left(k \cdot k\right)\right)}}{\frac{t}{\ell}} \cdot \ell} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k \cdot \left(k \cdot \left(k \cdot k\right)\right)} \cdot \frac{1}{\frac{t}{\ell}}\right), \ell\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{k}}{k \cdot \left(k \cdot k\right)} \cdot \frac{1}{\frac{t}{\ell}}\right), \ell\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{2}{k} \cdot 1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      4. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\left(\frac{2}{k} \cdot 1\right) \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      5. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{t}{\ell}}\right), \ell\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\left(k \cdot \left(k \cdot k\right)\right) \cdot \frac{1}{\frac{\ell}{t}}}\right), \ell\right) \]
      7. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{1}{\frac{k \cdot \left(k \cdot k\right)}{\frac{\ell}{t}}}\right), \ell\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{2}{k} \cdot \frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right), \ell\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{2}{k}\right), \left(\frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\right), \ell\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \left(\frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\right), \ell\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\left(\frac{\ell}{t}\right), \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \left(k \cdot \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, \left(k \cdot k\right)\right)\right)\right), \ell\right) \]
      14. *-lowering-*.f6478.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, k\right), \mathsf{/.f64}\left(\mathsf{/.f64}\left(\ell, t\right), \mathsf{*.f64}\left(k, \mathsf{*.f64}\left(k, k\right)\right)\right)\right), \ell\right) \]
    9. Applied egg-rr78.8%

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

    if 390 < k

    1. Initial program 29.0%

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{2}{t}}{\frac{\frac{t \cdot t}{\ell}}{\ell}}}{\sin k}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}}} \]
    4. Add Preprocessing
    5. Taylor expanded in k around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)}, \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot {t}^{3}}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left({t}^{3} \cdot k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left({t}^{3}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      8. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot {t}^{2}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left({t}^{2}\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
      12. *-lowering-*.f6429.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    7. Simplified29.0%

      \[\leadsto \frac{\frac{\color{blue}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{\left(t \cdot \left(t \cdot t\right)\right) \cdot k}}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}} \]
    8. Taylor expanded in k around 0

      \[\leadsto \color{blue}{\frac{\frac{-2}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\frac{{k}^{2} \cdot {\ell}^{2}}{t} \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      2. associate-/l*N/A

        \[\leadsto \frac{\left({k}^{2} \cdot \frac{{\ell}^{2}}{t}\right) \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      3. associate-*r*N/A

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

        \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right) + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
      5. +-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
    10. Simplified14.2%

      \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot \left(\left(k \cdot k\right) \cdot -0.6666666666666666 + 2\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
    11. Taylor expanded in k around inf

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

        \[\leadsto \frac{\frac{-2}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
      2. associate-/l/N/A

        \[\leadsto \frac{\frac{\frac{-2}{3} \cdot {\ell}^{2}}{t}}{\color{blue}{{k}^{2}}} \]
      3. associate-*r/N/A

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

        \[\leadsto \frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot \color{blue}{k}} \]
      5. associate-/r*N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k}\right), \color{blue}{k}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right), k\right), k\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-2}{3}\right), k\right), k\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-2}{3}\right), k\right), k\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
      12. *-lowering-*.f6449.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
    13. Simplified49.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;k \leq 390:\\ \;\;\;\;\ell \cdot \left(\frac{2}{k} \cdot \frac{\frac{\ell}{t}}{k \cdot \left(k \cdot k\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 29.6% accurate, 38.3× speedup?

\[\begin{array}{l} \\ \frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k} \end{array} \]
(FPCore (t l k)
 :precision binary64
 (/ (/ (* (/ (* l l) t) -0.6666666666666666) k) k))
double code(double t, double l, double k) {
	return ((((l * l) / t) * -0.6666666666666666) / k) / k;
}
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) / t) * (-0.6666666666666666d0)) / k) / k
end function
public static double code(double t, double l, double k) {
	return ((((l * l) / t) * -0.6666666666666666) / k) / k;
}
def code(t, l, k):
	return ((((l * l) / t) * -0.6666666666666666) / k) / k
function code(t, l, k)
	return Float64(Float64(Float64(Float64(Float64(l * l) / t) * -0.6666666666666666) / k) / k)
end
function tmp = code(t, l, k)
	tmp = ((((l * l) / t) * -0.6666666666666666) / k) / k;
end
code[t_, l_, k_] := N[(N[(N[(N[(N[(l * l), $MachinePrecision] / t), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] / k), $MachinePrecision] / k), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}
\end{array}
Derivation
  1. Initial program 33.5%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\frac{\frac{\frac{2}{t}}{\frac{\frac{t \cdot t}{\ell}}{\ell}}}{\sin k}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}}} \]
  4. Add Preprocessing
  5. Taylor expanded in k around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{{\ell}^{2}}{k \cdot {t}^{3}}\right)}, \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
  6. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{2 \cdot {\ell}^{2}}{k \cdot {t}^{3}}\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot {\ell}^{2}\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left({\ell}^{2}\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    4. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\ell \cdot \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left(k \cdot {t}^{3}\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \left({t}^{3} \cdot k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left({t}^{3}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    8. cube-multN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\left(t \cdot {t}^{2}\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left({t}^{2}\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \left(t \cdot t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
    12. *-lowering-*.f6432.1%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\ell, \ell\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(t, \mathsf{*.f64}\left(t, t\right)\right), k\right)\right), \mathsf{tan.f64}\left(k\right)\right), \mathsf{*.f64}\left(k, \mathsf{/.f64}\left(\mathsf{/.f64}\left(k, t\right), t\right)\right)\right) \]
  7. Simplified32.1%

    \[\leadsto \frac{\frac{\color{blue}{\frac{2 \cdot \left(\ell \cdot \ell\right)}{\left(t \cdot \left(t \cdot t\right)\right) \cdot k}}}{\tan k}}{k \cdot \frac{\frac{k}{t}}{t}} \]
  8. Taylor expanded in k around 0

    \[\leadsto \color{blue}{\frac{\frac{-2}{3} \cdot \frac{{k}^{2} \cdot {\ell}^{2}}{t} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}}} \]
  9. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{\frac{{k}^{2} \cdot {\ell}^{2}}{t} \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
    2. associate-/l*N/A

      \[\leadsto \frac{\left({k}^{2} \cdot \frac{{\ell}^{2}}{t}\right) \cdot \frac{-2}{3} + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
    3. associate-*r*N/A

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

      \[\leadsto \frac{{k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right) + 2 \cdot \frac{{\ell}^{2}}{t}}{{k}^{4}} \]
    5. +-commutativeN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \frac{{\ell}^{2}}{t} + {k}^{2} \cdot \left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right)\right), \color{blue}{\left({k}^{4}\right)}\right) \]
  10. Simplified44.4%

    \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \ell}{t} \cdot \left(\left(k \cdot k\right) \cdot -0.6666666666666666 + 2\right)}{\left(k \cdot k\right) \cdot \left(k \cdot k\right)}} \]
  11. Taylor expanded in k around inf

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

      \[\leadsto \frac{\frac{-2}{3} \cdot {\ell}^{2}}{\color{blue}{{k}^{2} \cdot t}} \]
    2. associate-/l/N/A

      \[\leadsto \frac{\frac{\frac{-2}{3} \cdot {\ell}^{2}}{t}}{\color{blue}{{k}^{2}}} \]
    3. associate-*r/N/A

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

      \[\leadsto \frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k \cdot \color{blue}{k}} \]
    5. associate-/r*N/A

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

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}}{k}\right), \color{blue}{k}\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot \frac{{\ell}^{2}}{t}\right), k\right), k\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{{\ell}^{2}}{t} \cdot \frac{-2}{3}\right), k\right), k\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\frac{{\ell}^{2}}{t}\right), \frac{-2}{3}\right), k\right), k\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left({\ell}^{2}\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\ell \cdot \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
    12. *-lowering-*.f6427.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), t\right), \frac{-2}{3}\right), k\right), k\right) \]
  13. Simplified27.9%

    \[\leadsto \color{blue}{\frac{\frac{\frac{\ell \cdot \ell}{t} \cdot -0.6666666666666666}{k}}{k}} \]
  14. Add Preprocessing

Reproduce

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