Average Error: 48.3 → 3.2
Time: 26.6s
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 := {\sin k}^{2}\\ t_2 := 2 \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t \cdot t_1}}{\frac{k}{\ell}}\right)\\ \mathbf{if}\;\ell \leq -4.3414506604533326 \cdot 10^{-181}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\ell \leq 1.2720644458459743 \cdot 10^{-243}:\\ \;\;\;\;\frac{2}{\frac{t \cdot \frac{k \cdot k}{\ell}}{\ell \cdot \frac{\cos k}{t_1}}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
\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 := {\sin k}^{2}\\
t_2 := 2 \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t \cdot t_1}}{\frac{k}{\ell}}\right)\\
\mathbf{if}\;\ell \leq -4.3414506604533326 \cdot 10^{-181}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;\ell \leq 1.2720644458459743 \cdot 10^{-243}:\\
\;\;\;\;\frac{2}{\frac{t \cdot \frac{k \cdot k}{\ell}}{\ell \cdot \frac{\cos k}{t_1}}}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\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 (pow (sin k) 2.0))
        (t_2 (* 2.0 (* (/ l k) (/ (/ (cos k) (* t t_1)) (/ k l))))))
   (if (<= l -4.3414506604533326e-181)
     t_2
     (if (<= l 1.2720644458459743e-243)
       (/ 2.0 (/ (* t (/ (* k k) l)) (* l (/ (cos k) t_1))))
       t_2))))
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 = pow(sin(k), 2.0);
	double t_2 = 2.0 * ((l / k) * ((cos(k) / (t * t_1)) / (k / l)));
	double tmp;
	if (l <= -4.3414506604533326e-181) {
		tmp = t_2;
	} else if (l <= 1.2720644458459743e-243) {
		tmp = 2.0 / ((t * ((k * k) / l)) / (l * (cos(k) / t_1)));
	} else {
		tmp = t_2;
	}
	return tmp;
}

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 2 regimes
  2. if l < -4.3414506604533326e-181 or 1.2720644458459743e-243 < l

    1. Initial program 49.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. Simplified41.3

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    5. Applied egg-rr8.1

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

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

    if -4.3414506604533326e-181 < l < 1.2720644458459743e-243

    1. Initial program 45.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. Simplified37.8

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

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

      \[\leadsto \frac{2}{\color{blue}{\frac{k \cdot k}{\ell \cdot \ell} \cdot \frac{t \cdot {\sin k}^{2}}{\cos k}}} \]
    5. Applied egg-rr6.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.3414506604533326 \cdot 10^{-181}:\\ \;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t \cdot {\sin k}^{2}}}{\frac{k}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 1.2720644458459743 \cdot 10^{-243}:\\ \;\;\;\;\frac{2}{\frac{t \cdot \frac{k \cdot k}{\ell}}{\ell \cdot \frac{\cos k}{{\sin k}^{2}}}}\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\frac{\ell}{k} \cdot \frac{\frac{\cos k}{t \cdot {\sin k}^{2}}}{\frac{k}{\ell}}\right)\\ \end{array} \]

Reproduce

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