~ubuntu-branches/ubuntu/precise/eglibc/precise

« back to all changes in this revision

Viewing changes to math/w_atanhl.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2011 Free Software Foundation, Inc.
2
 
   This file is part of the GNU C Library.
3
 
   Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
4
 
 
5
 
   The GNU C Library is free software; you can redistribute it and/or
6
 
   modify it under the terms of the GNU Lesser General Public
7
 
   License as published by the Free Software Foundation; either
8
 
   version 2.1 of the License, or (at your option) any later version.
9
 
 
10
 
   The GNU C Library is distributed in the hope that it will be useful,
11
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
   Lesser General Public License for more details.
14
 
 
15
 
   You should have received a copy of the GNU Lesser General Public
16
 
   License along with the GNU C Library; if not, write to the Free
17
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
 
   02111-1307 USA.  */
 
1
/* w_atanhl.c -- long double version of w_atanh.c.
 
2
 * Conversion to long double by Ulrich Drepper,
 
3
 * Cygnus Support, drepper@cygnus.com.
 
4
 */
 
5
 
 
6
/*
 
7
 * ====================================================
 
8
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
 
9
 *
 
10
 * Developed at SunPro, a Sun Microsystems, Inc. business.
 
11
 * Permission to use, copy, modify, and distribute this
 
12
 * software is freely granted, provided that this notice
 
13
 * is preserved.
 
14
 * ====================================================
 
15
 */
 
16
 
 
17
#if defined(LIBM_SCCS) && !defined(lint)
 
18
static char rcsid[] = "$NetBSD: $";
 
19
#endif
 
20
 
 
21
/*
 
22
 * wrapper atanhl(x)
 
23
 */
19
24
 
20
25
#include <math.h>
21
 
#include <math_private.h>
22
 
 
23
 
 
24
 
/* wrapper atanhl */
25
 
long double
26
 
__atanhl (long double x)
 
26
#include "math_private.h"
 
27
 
 
28
 
 
29
#ifdef __STDC__
 
30
        long double __atanhl(long double x)     /* wrapper atanhl */
 
31
#else
 
32
        long double __atanhl(x)                 /* wrapper atanhl */
 
33
        long double x;
 
34
#endif
27
35
{
28
 
  if (__builtin_expect (fabsl (x) >= 1.0L, 0) && _LIB_VERSION != _IEEE_)
29
 
    return __kernel_standard (x, x,
30
 
                              fabsl (x) > 1.0L
31
 
                              ? 230             /* atanh(|x|>1) */
32
 
                              : 231);           /* atanh(|x|==1) */
33
 
 
34
 
  return __ieee754_atanhl (x);
 
36
#ifdef _IEEE_LIBM
 
37
        return __ieee754_atanhl(x);
 
38
#else
 
39
        long double z,y;
 
40
        z = __ieee754_atanhl(x);
 
41
        if(_LIB_VERSION == _IEEE_ || __isnanl(x)) return z;
 
42
        y = fabsl(x);
 
43
        if(y>=1.0) {
 
44
            if(y>1.0)
 
45
                return __kernel_standard(x,x,230); /* atanhl(|x|>1) */
 
46
            else
 
47
                return __kernel_standard(x,x,231); /* atanhl(|x|==1) */
 
48
        } else
 
49
            return z;
 
50
#endif
35
51
}
36
52
weak_alias (__atanhl, atanhl)