\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2.5243988018988346 \cdot 10^{+25} \lor \neg \left(\pi \cdot \ell \leq 2.1864373228930277 \cdot 10^{-14}\right):\\
\;\;\;\;\pi \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{F}\\
\end{array}(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
:precision binary64
(if (or (<= (* PI l) -2.5243988018988346e+25)
(not (<= (* PI l) 2.1864373228930277e-14)))
(* PI l)
(- (* PI l) (* (/ 1.0 F) (/ (tan (* PI l)) F)))))double code(double F, double l) {
return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan(((double) M_PI) * l));
}
double code(double F, double l) {
double tmp;
if (((((double) M_PI) * l) <= -2.5243988018988346e+25) || !((((double) M_PI) * l) <= 2.1864373228930277e-14)) {
tmp = ((double) M_PI) * l;
} else {
tmp = (((double) M_PI) * l) - ((1.0 / F) * (tan(((double) M_PI) * l) / F));
}
return tmp;
}













Bits error versus F













Bits error versus l
Results
| Alternative 1 | |
|---|---|
| Error | 1.0 |
| Cost | 7688 |
| Alternative 2 | |
|---|---|
| Error | 1.2 |
| Cost | 1288 |
| Alternative 3 | |
|---|---|
| Error | 1.2 |
| Cost | 1288 |
| Alternative 4 | |
|---|---|
| Error | 5.3 |
| Cost | 1160 |
| Alternative 5 | |
|---|---|
| Error | 14.3 |
| Cost | 2956 |
| Alternative 6 | |
|---|---|
| Error | 14.3 |
| Cost | 2892 |
| Alternative 7 | |
|---|---|
| Error | 14.3 |
| Cost | 2892 |
| Alternative 8 | |
|---|---|
| Error | 14.3 |
| Cost | 2138 |
| Alternative 9 | |
|---|---|
| Error | 13.7 |
| Cost | 192 |
| Alternative 10 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |


if (*.f64 PI.f64 l) < -2.5243988018988346e25 or 2.1864373228930277e-14 < (*.f64 PI.f64 l) Initial program 23.3
Taylor expanded around 0 32.6
Simplified32.6
Taylor expanded around inf 1.0
rmApplied *-un-lft-identity_binary641.0
rmApplied *-un-lft-identity_binary641.0
Simplified1.0
if -2.5243988018988346e25 < (*.f64 PI.f64 l) < 2.1864373228930277e-14Initial program 10.0
rmApplied *-un-lft-identity_binary6410.0
Applied times-frac_binary6410.0
Applied associate-*l*_binary641.2
Simplified1.1
Simplified1.1
Final simplification1.0
herbie shell --seed 2021065
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))