Average Error: 32.8 → 12.1
Time: 13.0s
Precision: binary64
\[\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)} \]
\[\begin{array}{l} t_1 := \sqrt[3]{\sin k}\\ t_2 := 2 + {\left(\frac{k}{t}\right)}^{2}\\ t_3 := \frac{{2}^{0.3333333333333333}}{t}\\ \mathbf{if}\;t \leq -1 \cdot 10^{-40}:\\ \;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{t_3}{t_1}}{\sqrt[3]{\tan k} \cdot \sqrt[3]{t_2}}\right)}^{3}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-40}:\\ \;\;\;\;\ell \cdot \left(2 \cdot \frac{\frac{\frac{\cos k}{\frac{k \cdot k}{\ell}}}{t}}{{\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{t_3}{\mathsf{log1p}\left(\mathsf{expm1}\left(t_1\right)\right)}}{\sqrt[3]{\tan k \cdot t_2}}\right)}^{3}\\ \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))))
(FPCore (t l k)
 :precision binary64
 (let* ((t_1 (cbrt (sin k)))
        (t_2 (+ 2.0 (pow (/ k t) 2.0)))
        (t_3 (/ (pow 2.0 0.3333333333333333) t)))
   (if (<= t -1e-40)
     (* l (pow (* (cbrt l) (/ (/ t_3 t_1) (* (cbrt (tan k)) (cbrt t_2)))) 3.0))
     (if (<= t 2.2e-40)
       (* l (* 2.0 (/ (/ (/ (cos k) (/ (* k k) l)) t) (pow (sin k) 2.0))))
       (*
        l
        (pow
         (* (cbrt l) (/ (/ t_3 (log1p (expm1 t_1))) (cbrt (* (tan k) t_2))))
         3.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));
}
double code(double t, double l, double k) {
	double t_1 = cbrt(sin(k));
	double t_2 = 2.0 + pow((k / t), 2.0);
	double t_3 = pow(2.0, 0.3333333333333333) / t;
	double tmp;
	if (t <= -1e-40) {
		tmp = l * pow((cbrt(l) * ((t_3 / t_1) / (cbrt(tan(k)) * cbrt(t_2)))), 3.0);
	} else if (t <= 2.2e-40) {
		tmp = l * (2.0 * (((cos(k) / ((k * k) / l)) / t) / pow(sin(k), 2.0)));
	} else {
		tmp = l * pow((cbrt(l) * ((t_3 / log1p(expm1(t_1))) / cbrt((tan(k) * t_2)))), 3.0);
	}
	return tmp;
}
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));
}
public static double code(double t, double l, double k) {
	double t_1 = Math.cbrt(Math.sin(k));
	double t_2 = 2.0 + Math.pow((k / t), 2.0);
	double t_3 = Math.pow(2.0, 0.3333333333333333) / t;
	double tmp;
	if (t <= -1e-40) {
		tmp = l * Math.pow((Math.cbrt(l) * ((t_3 / t_1) / (Math.cbrt(Math.tan(k)) * Math.cbrt(t_2)))), 3.0);
	} else if (t <= 2.2e-40) {
		tmp = l * (2.0 * (((Math.cos(k) / ((k * k) / l)) / t) / Math.pow(Math.sin(k), 2.0)));
	} else {
		tmp = l * Math.pow((Math.cbrt(l) * ((t_3 / Math.log1p(Math.expm1(t_1))) / Math.cbrt((Math.tan(k) * t_2)))), 3.0);
	}
	return tmp;
}
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 code(t, l, k)
	t_1 = cbrt(sin(k))
	t_2 = Float64(2.0 + (Float64(k / t) ^ 2.0))
	t_3 = Float64((2.0 ^ 0.3333333333333333) / t)
	tmp = 0.0
	if (t <= -1e-40)
		tmp = Float64(l * (Float64(cbrt(l) * Float64(Float64(t_3 / t_1) / Float64(cbrt(tan(k)) * cbrt(t_2)))) ^ 3.0));
	elseif (t <= 2.2e-40)
		tmp = Float64(l * Float64(2.0 * Float64(Float64(Float64(cos(k) / Float64(Float64(k * k) / l)) / t) / (sin(k) ^ 2.0))));
	else
		tmp = Float64(l * (Float64(cbrt(l) * Float64(Float64(t_3 / log1p(expm1(t_1))) / cbrt(Float64(tan(k) * t_2)))) ^ 3.0));
	end
	return tmp
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]
code[t_, l_, k_] := Block[{t$95$1 = N[Power[N[Sin[k], $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$2 = N[(2.0 + N[Power[N[(k / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[2.0, 0.3333333333333333], $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[t, -1e-40], N[(l * N[Power[N[(N[Power[l, 1/3], $MachinePrecision] * N[(N[(t$95$3 / t$95$1), $MachinePrecision] / N[(N[Power[N[Tan[k], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[t$95$2, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e-40], N[(l * N[(2.0 * N[(N[(N[(N[Cos[k], $MachinePrecision] / N[(N[(k * k), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] / N[Power[N[Sin[k], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * N[Power[N[(N[Power[l, 1/3], $MachinePrecision] * N[(N[(t$95$3 / N[Log[1 + N[(Exp[t$95$1] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Power[N[(N[Tan[k], $MachinePrecision] * t$95$2), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]]]]]]
\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)}
\begin{array}{l}
t_1 := \sqrt[3]{\sin k}\\
t_2 := 2 + {\left(\frac{k}{t}\right)}^{2}\\
t_3 := \frac{{2}^{0.3333333333333333}}{t}\\
\mathbf{if}\;t \leq -1 \cdot 10^{-40}:\\
\;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{t_3}{t_1}}{\sqrt[3]{\tan k} \cdot \sqrt[3]{t_2}}\right)}^{3}\\

\mathbf{elif}\;t \leq 2.2 \cdot 10^{-40}:\\
\;\;\;\;\ell \cdot \left(2 \cdot \frac{\frac{\frac{\cos k}{\frac{k \cdot k}{\ell}}}{t}}{{\sin k}^{2}}\right)\\

\mathbf{else}:\\
\;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{t_3}{\mathsf{log1p}\left(\mathsf{expm1}\left(t_1\right)\right)}}{\sqrt[3]{\tan k \cdot t_2}}\right)}^{3}\\


\end{array}

Error

Bits error versus t

Bits error versus l

Bits error versus k

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if t < -9.9999999999999993e-41

    1. Initial program 22.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. Simplified17.9

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

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

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

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

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

    if -9.9999999999999993e-41 < t < 2.20000000000000009e-40

    1. Initial program 54.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. Simplified54.5

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

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

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

    if 2.20000000000000009e-40 < t

    1. Initial program 22.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. Simplified18.6

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

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

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

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

      \[\leadsto \ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{\frac{{2}^{0.3333333333333333}}{t}}{\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{\sin k}\right)\right)}}}{\sqrt[3]{\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}}\right)}^{3} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification12.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-40}:\\ \;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{\frac{{2}^{0.3333333333333333}}{t}}{\sqrt[3]{\sin k}}}{\sqrt[3]{\tan k} \cdot \sqrt[3]{2 + {\left(\frac{k}{t}\right)}^{2}}}\right)}^{3}\\ \mathbf{elif}\;t \leq 2.2 \cdot 10^{-40}:\\ \;\;\;\;\ell \cdot \left(2 \cdot \frac{\frac{\frac{\cos k}{\frac{k \cdot k}{\ell}}}{t}}{{\sin k}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot {\left(\sqrt[3]{\ell} \cdot \frac{\frac{\frac{{2}^{0.3333333333333333}}{t}}{\mathsf{log1p}\left(\mathsf{expm1}\left(\sqrt[3]{\sin k}\right)\right)}}{\sqrt[3]{\tan k \cdot \left(2 + {\left(\frac{k}{t}\right)}^{2}\right)}}\right)}^{3}\\ \end{array} \]

Reproduce

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