Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ License along with this library; if not, see
+ <https://www.gnu.org/licenses/>. */
/* __ieee754_coshl(x)
* Method :
* only coshl(0)=1 is exact for finite x.
*/
-#include "math.h"
-#include "math_private.h"
+#include <math.h>
+#include <math_private.h>
-static const long double one = 1.0, half = 0.5, huge = 1.0e4900L,
-ovf_thresh = 1.1357216553474703894801348310092223067821E4L;
+static const _Float128 one = 1.0, half = 0.5, huge = L(1.0e4900),
+ovf_thresh = L(1.1357216553474703894801348310092223067821E4);
-long double
-__ieee754_coshl (long double x)
+_Float128
+__ieee754_coshl (_Float128 x)
{
- long double t, w;
+ _Float128 t, w;
int32_t ex;
ieee854_long_double_shape_type u;
/* |x| in [0,0.5*ln2], return 1+expm1l(|x|)^2/(2*expl(|x|)) */
if (ex < 0x3ffd62e4) /* 0.3465728759765625 */
{
+ if (ex < 0x3fb80000) /* |x| < 2^-116 */
+ return one; /* cosh(tiny) = 1 */
t = __expm1l (u.value);
w = one + t;
- if (ex < 0x3fb80000) /* |x| < 2^-116 */
- return w; /* cosh(tiny) = 1 */
return one + (t * t) / (w + w);
}