| 91 | } |
| 92 | |
| 93 | template<class T, class Policies> inline |
| 94 | interval<T, Policies> tan(const interval<T, Policies>& x) |
| 95 | { |
| 96 | typedef interval<T, Policies> I; |
| 97 | if (interval_lib::detail::test_input(x)) |
| 98 | return I::empty(); |
| 99 | typename Policies::rounding rnd; |
| 100 | typedef typename interval_lib::unprotect<I>::type R; |
| 101 | |
| 102 | // get lower bound within [-pi/2, pi/2] |
| 103 | const R pi = interval_lib::pi<R>(); |
| 104 | R tmp = fmod((const R&)x, pi); |
| 105 | const T pi_half_d = interval_lib::constants::pi_half_lower<T>(); |
| 106 | if (tmp.lower() >= pi_half_d) |
| 107 | tmp -= pi; |
| 108 | if (tmp.lower() <= -pi_half_d || tmp.upper() >= pi_half_d) |
| 109 | return I::whole(); |
| 110 | return I(rnd.tan_down(tmp.lower()), rnd.tan_up(tmp.upper()), true); |
| 111 | } |
| 112 | |
| 113 | template<class T, class Policies> inline |
| 114 | interval<T, Policies> asin(const interval<T, Policies>& x) |
nothing calls this directly
no test coverage detected