\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1.7804560111184658 \cdot 10^{+162}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\sqrt[3]{\pi \cdot \ell} \cdot \left(\sqrt[3]{\pi \cdot \ell} \cdot \sqrt[3]{\pi \cdot \ell}\right)\right) \cdot F}}{F}\\
\mathbf{elif}\;\pi \cdot \ell \leq 2.428756404616689 \cdot 10^{+151}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F \cdot \left(\left(1 + 0.041666666666666664 \cdot {\left(\pi \cdot \ell\right)}^{4}\right) - {\pi}^{2} \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.5\right)\right)}}{F}\\
\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F \cdot \cos \left(\left(\sqrt[3]{\sqrt{\pi}} \cdot \left(\sqrt[3]{\sqrt{\pi}} \cdot \sqrt[3]{\sqrt{\pi}}\right)\right) \cdot \left(\ell \cdot \sqrt{\pi}\right)\right)}}{F}\\
\end{array}(FPCore (F l) :precision binary64 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
:precision binary64
(if (<= (* PI l) -1.7804560111184658e+162)
(-
(* PI l)
(/
(/
(sin (* PI l))
(* (cos (* (cbrt (* PI l)) (* (cbrt (* PI l)) (cbrt (* PI l))))) F))
F))
(if (<= (* PI l) 2.428756404616689e+151)
(-
(* PI l)
(/
(/
(sin (* PI l))
(*
F
(-
(+ 1.0 (* 0.041666666666666664 (pow (* PI l) 4.0)))
(* (pow PI 2.0) (* (* l l) 0.5)))))
F))
(-
(* PI l)
(/
(/
(sin (* PI l))
(*
F
(cos
(*
(* (cbrt (sqrt PI)) (* (cbrt (sqrt PI)) (cbrt (sqrt PI))))
(* l (sqrt PI))))))
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) <= -1.7804560111184658e+162) {
tmp = (((double) M_PI) * l) - ((sin(((double) M_PI) * l) / (cos(cbrt(((double) M_PI) * l) * (cbrt(((double) M_PI) * l) * cbrt(((double) M_PI) * l))) * F)) / F);
} else if ((((double) M_PI) * l) <= 2.428756404616689e+151) {
tmp = (((double) M_PI) * l) - ((sin(((double) M_PI) * l) / (F * ((1.0 + (0.041666666666666664 * pow((((double) M_PI) * l), 4.0))) - (pow(((double) M_PI), 2.0) * ((l * l) * 0.5))))) / F);
} else {
tmp = (((double) M_PI) * l) - ((sin(((double) M_PI) * l) / (F * cos((cbrt(sqrt((double) M_PI)) * (cbrt(sqrt((double) M_PI)) * cbrt(sqrt((double) M_PI)))) * (l * sqrt((double) M_PI))))) / F);
}
return tmp;
}









Bits error versus F









Bits error versus l
Results
| Alternative 1 | |
|---|---|
| Accuracy | 8.8 |
| Cost | 2690 |
| Alternative 2 | |
|---|---|
| Accuracy | 8.8 |
| Cost | 2690 |
| Alternative 3 | |
|---|---|
| Accuracy | 8.8 |
| Cost | 2690 |
| Alternative 4 | |
|---|---|
| Accuracy | 8.8 |
| Cost | 2690 |
| Alternative 5 | |
|---|---|
| Accuracy | 12.8 |
| Cost | 1344 |
| Alternative 6 | |
|---|---|
| Accuracy | 13.1 |
| Cost | 1920 |
if (*.f64 PI.f64 l) < -1.78045601111846582e162Initial program 22.6
Simplified22.6
rmApplied associate-/r*_binary6422.6
rmApplied tan-quot_binary6422.6
Applied associate-/l/_binary6422.6
Simplified22.6
rmApplied add-cube-cbrt_binary6422.5
if -1.78045601111846582e162 < (*.f64 PI.f64 l) < 2.42875640461669e151Initial program 15.9
Simplified15.5
rmApplied associate-/r*_binary649.7
rmApplied tan-quot_binary649.7
Applied associate-/l/_binary649.7
Simplified9.7
Taylor expanded around 0 4.2
Simplified4.2
if 2.42875640461669e151 < (*.f64 PI.f64 l) Initial program 20.7
Simplified20.7
rmApplied associate-/r*_binary6420.7
rmApplied tan-quot_binary6420.7
Applied associate-/l/_binary6420.7
Simplified20.7
rmApplied add-sqr-sqrt_binary6420.7
Applied associate-*l*_binary6420.7
Simplified20.7
rmApplied add-cube-cbrt_binary6420.6
Final simplification8.8
herbie shell --seed 2020322
(FPCore (F l)
:name "VandenBroeck and Keller, Equation (6)"
:precision binary64
(- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))