Average Error: 47.7 → 13.3
Time: 21.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} \mathbf{if}\;t \leq -1.0005272868091162 \cdot 10^{-84} \lor \neg \left(t \leq -1.2330902422552477 \cdot 10^{-113}\right):\\ \;\;\;\;2 \cdot \frac{\frac{\ell}{\frac{k}{\ell}} \cdot \cos k}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\sin k \cdot \frac{t \cdot t}{\ell}\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{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}\;t \leq -1.0005272868091162 \cdot 10^{-84} \lor \neg \left(t \leq -1.2330902422552477 \cdot 10^{-113}\right):\\
\;\;\;\;2 \cdot \frac{\frac{\ell}{\frac{k}{\ell}} \cdot \cos k}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\sin k \cdot \frac{t \cdot t}{\ell}\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{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 (<= t -1.0005272868091162e-84) (not (<= t -1.2330902422552477e-113)))
   (* 2.0 (/ (* (/ l (/ k l)) (cos k)) (* k (* t (pow (sin k) 2.0)))))
   (/
    2.0
    (* (* (* (/ t l) (* (sin k) (/ (* t t) l))) (tan k)) (pow (/ k t) 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 ((t <= -1.0005272868091162e-84) || !(t <= -1.2330902422552477e-113)) {
		tmp = 2.0 * (((l / (k / l)) * cos(k)) / (k * (t * pow(sin(k), 2.0))));
	} else {
		tmp = 2.0 / ((((t / l) * (sin(k) * ((t * t) / l))) * tan(k)) * pow((k / t), 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 t < -1.00052728680911615e-84 or -1.2330902422552477e-113 < t

    1. Initial program 47.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. Simplified40.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 around inf 22.1

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

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

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

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

      \[\leadsto 2 \cdot \frac{\color{blue}{\frac{\ell \cdot \ell}{k} \cdot \cos k}}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\]
    10. Using strategy rm
    11. Applied associate-/l*_binary64_36413.0

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

    if -1.00052728680911615e-84 < t < -1.2330902422552477e-113

    1. Initial program 43.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. Simplified43.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. Using strategy rm
    4. Applied cube-mult_binary64_44943.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}}\]
    5. Applied times-frac_binary64_42527.9

      \[\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}}\]
    6. Applied associate-*l*_binary64_36027.5

      \[\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}}\]
    7. Simplified27.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.0005272868091162 \cdot 10^{-84} \lor \neg \left(t \leq -1.2330902422552477 \cdot 10^{-113}\right):\\ \;\;\;\;2 \cdot \frac{\frac{\ell}{\frac{k}{\ell}} \cdot \cos k}{k \cdot \left(t \cdot {\sin k}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\left(\left(\frac{t}{\ell} \cdot \left(\sin k \cdot \frac{t \cdot t}{\ell}\right)\right) \cdot \tan k\right) \cdot {\left(\frac{k}{t}\right)}^{2}}\\ \end{array}\]

Reproduce

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