\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}\;k \leq -2.806566223980714 \cdot 10^{-19} \lor \neg \left(k \leq 1.0482771448169259 \cdot 10^{-116}\right):\\
\;\;\;\;\frac{\ell}{k} \cdot \frac{\frac{2}{\frac{k}{\ell}}}{\frac{t \cdot {\sin k}^{2}}{\cos k}}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{k \cdot k}{\ell} \cdot \left(t \cdot \frac{k \cdot k}{\ell}\right)}\\
\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 (<= k -2.806566223980714e-19) (not (<= k 1.0482771448169259e-116))) (* (/ l k) (/ (/ 2.0 (/ k l)) (/ (* t (pow (sin k) 2.0)) (cos k)))) (/ 2.0 (* (/ (* k k) l) (* t (/ (* k k) l))))))
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 ((k <= -2.806566223980714e-19) || !(k <= 1.0482771448169259e-116)) {
tmp = (l / k) * ((2.0 / (k / l)) / ((t * pow(sin(k), 2.0)) / cos(k)));
} else {
tmp = 2.0 / (((k * k) / l) * (t * ((k * k) / l)));
}
return tmp;
}









Bits error versus t









Bits error versus l









Bits error versus k
Results
| Alternative 1 | |
|---|---|
| Error | 5.9 |
| Cost | 20552 |
| Alternative 2 | |
|---|---|
| Error | 15.9 |
| Cost | 20552 |
| Alternative 3 | |
|---|---|
| Error | 24.2 |
| Cost | 960 |
| Alternative 4 | |
|---|---|
| Error | 26.3 |
| Cost | 960 |
| Alternative 5 | |
|---|---|
| Error | 34.6 |
| Cost | 64 |
| Alternative 6 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |


if k < -2.8065662239807141e-19 or 1.04827714481692591e-116 < k Initial program 45.6
Taylor expanded around 0 20.0
Simplified20.0
rmApplied associate-*l*_binary64_1917.7
rmApplied times-frac_binary64_8415.6
Applied associate-/r*_binary64_2215.4
rmApplied *-un-lft-identity_binary64_7815.4
Applied times-frac_binary64_8415.4
Applied *-un-lft-identity_binary64_7815.4
Applied times-frac_binary64_8410.1
Applied *-un-lft-identity_binary64_7810.1
Applied times-frac_binary64_849.9
Applied times-frac_binary64_840.9
Simplified0.8
Simplified0.8
if -2.8065662239807141e-19 < k < 1.04827714481692591e-116Initial program 62.6
Taylor expanded around 0 47.9
Simplified44.7
rmApplied associate-/r/_binary64_2444.7
Applied sqr-pow_binary64_5044.8
Applied times-frac_binary64_8423.6
Simplified15.7
Simplified15.7
Simplified15.7
Final simplification2.9
herbie shell --seed 2021065
(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))))