Average Error: 48.1 → 16.7
Time: 31.7s
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 := t \cdot {\sin k}^{2}\\ t_2 := \cos k \cdot \left(\ell \cdot \ell\right)\\ t_3 := \frac{2}{\left(\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ t_4 := \frac{2}{0 - \left(0 - \frac{k \cdot \left(k \cdot t_1\right)}{t_2}\right)}\\ \mathbf{if}\;\ell \leq -1.3490728451797633 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -2.9070642065808076 \cdot 10^{-74}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;\ell \leq 1.289879017838036 \cdot 10^{+21}:\\ \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{t_1}{t_2}}\\ \mathbf{elif}\;\ell \leq 1.376929976568877 \cdot 10^{+154}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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 := t \cdot {\sin k}^{2}\\
t_2 := \cos k \cdot \left(\ell \cdot \ell\right)\\
t_3 := \frac{2}{\left(\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\
t_4 := \frac{2}{0 - \left(0 - \frac{k \cdot \left(k \cdot t_1\right)}{t_2}\right)}\\
\mathbf{if}\;\ell \leq -1.3490728451797633 \cdot 10^{+154}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;\ell \leq -2.9070642065808076 \cdot 10^{-74}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;\ell \leq 1.289879017838036 \cdot 10^{+21}:\\
\;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{t_1}{t_2}}\\

\mathbf{elif}\;\ell \leq 1.376929976568877 \cdot 10^{+154}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_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 (* t (pow (sin k) 2.0)))
        (t_2 (* (cos k) (* l l)))
        (t_3
         (/
          2.0
          (*
           (* (* (pow (/ t (pow (cbrt l) 2.0)) 3.0) (sin k)) (tan k))
           (pow (/ k t) 2.0))))
        (t_4 (/ 2.0 (- 0.0 (- 0.0 (/ (* k (* k t_1)) t_2))))))
   (if (<= l -1.3490728451797633e+154)
     t_3
     (if (<= l -2.9070642065808076e-74)
       t_4
       (if (<= l 1.289879017838036e+21)
         (/ 2.0 (* (* k k) (/ t_1 t_2)))
         (if (<= l 1.376929976568877e+154) t_4 t_3))))))
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 = t * pow(sin(k), 2.0);
	double t_2 = cos(k) * (l * l);
	double t_3 = 2.0 / (((pow((t / pow(cbrt(l), 2.0)), 3.0) * sin(k)) * tan(k)) * pow((k / t), 2.0));
	double t_4 = 2.0 / (0.0 - (0.0 - ((k * (k * t_1)) / t_2)));
	double tmp;
	if (l <= -1.3490728451797633e+154) {
		tmp = t_3;
	} else if (l <= -2.9070642065808076e-74) {
		tmp = t_4;
	} else if (l <= 1.289879017838036e+21) {
		tmp = 2.0 / ((k * k) * (t_1 / t_2));
	} else if (l <= 1.376929976568877e+154) {
		tmp = t_4;
	} else {
		tmp = t_3;
	}
	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 3 regimes
  2. if l < -1.3490728451797633e154 or 1.37692997656887698e154 < l

    1. Initial program 64.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. Simplified64.0

      \[\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. Applied egg-rr38.8

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

    if -1.3490728451797633e154 < l < -2.90706420658080762e-74 or 1289879017838036120000 < l < 1.37692997656887698e154

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

      \[\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 16.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-rr10.4

      \[\leadsto \frac{2}{\frac{\color{blue}{\mathsf{fma}\left(k, k \cdot \left(t \cdot {\sin k}^{2}\right), -0 \cdot \left(t \cdot {\sin k}^{2}\right)\right) + \mathsf{fma}\left(0, t \cdot {\sin k}^{2}, 0 \cdot \left(t \cdot {\sin k}^{2}\right)\right)}}{\cos k \cdot {\ell}^{2}}} \]
    5. Applied egg-rr10.4

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

    if -2.90706420658080762e-74 < l < 1289879017838036120000

    1. Initial program 45.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. Simplified35.6

      \[\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 15.3

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.3490728451797633 \cdot 10^{+154}:\\ \;\;\;\;\frac{2}{\left(\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{elif}\;\ell \leq -2.9070642065808076 \cdot 10^{-74}:\\ \;\;\;\;\frac{2}{0 - \left(0 - \frac{k \cdot \left(k \cdot \left(t \cdot {\sin k}^{2}\right)\right)}{\cos k \cdot \left(\ell \cdot \ell\right)}\right)}\\ \mathbf{elif}\;\ell \leq 1.289879017838036 \cdot 10^{+21}:\\ \;\;\;\;\frac{2}{\left(k \cdot k\right) \cdot \frac{t \cdot {\sin k}^{2}}{\cos k \cdot \left(\ell \cdot \ell\right)}}\\ \mathbf{elif}\;\ell \leq 1.376929976568877 \cdot 10^{+154}:\\ \;\;\;\;\frac{2}{0 - \left(0 - \frac{k \cdot \left(k \cdot \left(t \cdot {\sin k}^{2}\right)\right)}{\cos k \cdot \left(\ell \cdot \ell\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left({\left(\frac{t}{{\left(\sqrt[3]{\ell}\right)}^{2}}\right)}^{3} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ \end{array} \]

Reproduce

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