Average Error: 48.5 → 16.4
Time: 26.2s
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} \mathbf{if}\;\ell \leq -1.523926379378027 \cdot 10^{+159} \lor \neg \left(\ell \leq 1.3604675236684082 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\frac{t \cdot t}{\ell} \cdot \sin k\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k}{\frac{\frac{\cos k \cdot {\ell}^{2}}{k}}{t \cdot {\sin k}^{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}
\mathbf{if}\;\ell \leq -1.523926379378027 \cdot 10^{+159} \lor \neg \left(\ell \leq 1.3604675236684082 \cdot 10^{+154}\right):\\
\;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\frac{t \cdot t}{\ell} \cdot \sin k\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k}{\frac{\frac{\cos k \cdot {\ell}^{2}}{k}}{t \cdot {\sin k}^{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
 (if (or (<= l -1.523926379378027e+159) (not (<= l 1.3604675236684082e+154)))
   (/
    2.0
    (* (* (* (/ t l) (* (/ (* t t) l) (sin k))) (tan k)) (pow (/ k t) 2.0)))
   (/ 2.0 (/ k (/ (/ (* (cos k) (pow l 2.0)) k) (* t (pow (sin k) 2.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 tmp;
	if ((l <= -1.523926379378027e+159) || !(l <= 1.3604675236684082e+154)) {
		tmp = 2.0 / ((((t / l) * (((t * t) / l) * sin(k))) * tan(k)) * pow((k / t), 2.0));
	} else {
		tmp = 2.0 / (k / (((cos(k) * pow(l, 2.0)) / k) / (t * pow(sin(k), 2.0))));
	}
	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 < -1.523926379378027e159 or 1.36046752366840816e154 < 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 cube-mult_binary6464.0

      \[\leadsto \frac{2}{\left(\left(\frac{\color{blue}{t \cdot \left(t \cdot t\right)}}{\ell \cdot \ell} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}} \]
    4. Applied times-frac_binary6449.5

      \[\leadsto \frac{2}{\left(\left(\color{blue}{\left(\frac{t}{\ell} \cdot \frac{t \cdot t}{\ell}\right)} \cdot \sin k\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}} \]
    5. Applied associate-*l*_binary6449.4

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

    if -1.523926379378027e159 < l < 1.36046752366840816e154

    1. Initial program 45.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. Simplified36.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 15.8

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.523926379378027 \cdot 10^{+159} \lor \neg \left(\ell \leq 1.3604675236684082 \cdot 10^{+154}\right):\\ \;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\frac{t \cdot t}{\ell} \cdot \sin k\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{k}{\frac{\frac{\cos k \cdot {\ell}^{2}}{k}}{t \cdot {\sin k}^{2}}}}\\ \end{array} \]

Reproduce

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